Skip to content

Commit

Permalink
fix: successful POST request always return a 201 response. Improve so…
Browse files Browse the repository at this point in the history
…me descriptions
  • Loading branch information
pulsargranular committed Jan 23, 2025
1 parent 76d4849 commit 2f3f904
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
24 changes: 12 additions & 12 deletions backend/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ paths:
$ref: "#/components/schemas/CreateDatasetBody"
required: true
responses:
"200":
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/CreateDatasetResp"
description: Successful Response
description: Dataset Created
"422":
content:
application/json:
Expand All @@ -47,25 +47,25 @@ paths:
$ref: "#/components/schemas/CreateJobBody"
required: true
responses:
"200":
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/CreateJobResp"
description: Successful Response
description: Job Created
"422":
content:
application/json:
schema:
$ref: "#/components/schemas/HTTPValidationError"
description: Validation Error
description: Data Validation Error
"500":
content:
application/json:
schema:
$ref: "#/components/schemas/InternalError"
description: Internal Server Error
summary: Job Created
summary: Create Archiver Job
tags:
- archiving
/s3/presignedUrls:
Expand All @@ -78,12 +78,12 @@ paths:
$ref: "#/components/schemas/PresignedUrlBody"
required: true
responses:
"200":
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/PresignedUrlResp"
description: Successful Response
description: Presigned URLs created
"422":
content:
application/json:
Expand All @@ -109,12 +109,12 @@ paths:
$ref: "#/components/schemas/CompleteUploadBody"
required: true
responses:
"200":
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteUploadResp"
description: Successful Response
description: Upload completed
"422":
content:
application/json:
Expand All @@ -140,12 +140,12 @@ paths:
$ref: "#/components/schemas/AbortUploadBody"
required: true
responses:
"200":
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/AbortUploadResp"
description: Successful Response
description: Abort multipart upload requested
"422":
content:
application/json:
Expand Down
8 changes: 4 additions & 4 deletions backend/api/src/openapi_server/apis/archiving_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
@router.post(
"/archiver/jobs",
responses={
200: {"model": CreateJobResp, "description": "Successful Response"},
422: {"model": HTTPValidationError, "description": "Validation Error"},
201: {"model": CreateJobResp, "description": "Job Created"},
422: {"model": HTTPValidationError, "description": "Data Validation Error"},
500: {"model": InternalError, "description": "Internal Server Error"},
},
tags=["archiving"],
summary="Job Created",
summary="Create Archiver Job",
response_model_by_alias=True,
)
async def create_job(
Expand All @@ -60,7 +60,7 @@ async def create_job(
@router.post(
"/archiver/new_dataset",
responses={
200: {"model": CreateDatasetResp, "description": "Successful Response"},
201: {"model": CreateDatasetResp, "description": "Dataset Created"},
422: {"model": HTTPValidationError, "description": "Validation Error"},
500: {"model": InternalError, "description": "Internal Server Error"},
},
Expand Down
6 changes: 3 additions & 3 deletions backend/api/src/openapi_server/apis/presigned_urls_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
@router.post(
"/s3/abortMultipartUpload",
responses={
200: {"model": AbortUploadResp, "description": "Successful Response"},
201: {"model": AbortUploadResp, "description": "Abort multipart upload requested"},
422: {"model": HTTPValidationError, "description": "Validation Error"},
500: {"model": InternalError, "description": "Internal Server Error"},
},
Expand All @@ -62,7 +62,7 @@ async def abort_multipart_upload(
@router.post(
"/s3/completeUpload",
responses={
200: {"model": CompleteUploadResp, "description": "Successful Response"},
201: {"model": CompleteUploadResp, "description": "Upload completed"},
422: {"model": HTTPValidationError, "description": "Validation Error"},
500: {"model": InternalError, "description": "Internal Server Error"},
},
Expand All @@ -81,7 +81,7 @@ async def complete_upload(
@router.post(
"/s3/presignedUrls",
responses={
200: {"model": PresignedUrlResp, "description": "Successful Response"},
201: {"model": PresignedUrlResp, "description": "Presigned URLs created"},
422: {"model": HTTPValidationError, "description": "Validation Error"},
500: {"model": InternalError, "description": "Internal Server Error"},
},
Expand Down

0 comments on commit 2f3f904

Please sign in to comment.