Skip to content

Commit

Permalink
Merge pull request #553 from openedx/sameen/fix-revoke-endpoint
Browse files Browse the repository at this point in the history
fix: fixed response status for bulk-revoke endpoint
  • Loading branch information
sameenfatima78 authored Jan 3, 2024
2 parents 9faef7a + 1f3037b commit 8ea5ecd
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 10 deletions.
41 changes: 37 additions & 4 deletions api-compact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ apigateway_responses: &apigateway_responses
500:
statusCode: "500"

bulk_revoke_apigateway_responses: &bulk_revoke_apigateway_responses
default:
statusCode: "400"
204:
statusCode: "204"
401:
statusCode: "401"
403:
statusCode: "403"
404:
statusCode: "404"
429:
statusCode: "429"
500:
statusCode: "500"


apigateway_responses_with_mapping_template_for_uuid: &apigateway_responses_with_mapping_template_for_uuid
default:
statusCode: "400"
Expand Down Expand Up @@ -78,6 +95,22 @@ responses: &responses
500:
description: "Internal Server Error"

bulk_revoke_responses: &bulk_revoke_responses
204:
description: "No Content - All revocations were successful"
400:
description: "Bad Request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not Found"
429:
description: "Too Many Requests"
500:
description: "Internal Server Error"

produces: &produces
- "application/json"
- "application/csv"
Expand Down Expand Up @@ -195,11 +228,11 @@ endpoints:
type: "string"
description: "user email"
filters:
description: "List of emails with which licenses are associated"
description: "Filters for lookup and filtering of licenses to revoke."
type: "array"
items:
type: "object"
description: "filter"
description: "Values provided to perform filtering against."
properties:
user_email:
description: "User email filter"
Expand All @@ -210,9 +243,9 @@ endpoints:
items:
type: "string"
description: "status of the license"
responses: *responses
responses: *bulk_revoke_responses
x-amazon-apigateway-integration:
responses: *apigateway_responses
responses: *bulk_revoke_apigateway_responses
httpMethod: "POST"
type: "http"
requestParameters:
Expand Down
42 changes: 36 additions & 6 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ apigateway_responses:
statusCode: "500"
default:
statusCode: "400"
bulk_revoke_apigateway_responses:
"204":
statusCode: "204"
"401":
statusCode: "401"
"403":
statusCode: "403"
"404":
statusCode: "404"
"429":
statusCode: "429"
"500":
statusCode: "500"
default:
statusCode: "400"
apigateway_responses_with_mapping_template_for_uuid:
"200":
statusCode: "200"
Expand Down Expand Up @@ -60,6 +75,21 @@ responses:
description: Too Many Requests
"500":
description: Internal Server Error
bulk_revoke_responses:
"204":
description: No Content - All revocations were successful
"400":
description: Bad Request
"401":
description: Unauthorized
"403":
description: Forbidden
"404":
description: Not Found
"429":
description: Too Many Requests
"500":
description: Internal Server Error
produces:
- application/json
- application/csv
Expand Down Expand Up @@ -208,11 +238,11 @@ endpoints:
type: string
description: user email
filters:
description: List of emails with which licenses are associated
description: Filters for lookup and filtering of licenses to revoke.
type: array
items:
type: object
description: filter
description: Values provided to perform filtering against.
properties:
user_email:
description: User email filter
Expand All @@ -224,8 +254,8 @@ endpoints:
type: string
description: status of the license
responses:
"200":
description: OK
"204":
description: No Content - All revocations were successful
"400":
description: Bad Request
"401":
Expand All @@ -240,8 +270,8 @@ endpoints:
description: Internal Server Error
x-amazon-apigateway-integration:
responses:
"200":
statusCode: "200"
"204":
statusCode: "204"
"401":
statusCode: "401"
"403":
Expand Down

0 comments on commit 8ea5ecd

Please sign in to comment.