Skip to content

Commit

Permalink
Update error response schema
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-murray authored Dec 16, 2024
1 parent aff4b46 commit a710d62
Showing 1 changed file with 106 additions and 23 deletions.
129 changes: 106 additions & 23 deletions code/API_definitions/kyc-tenure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,17 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 400
code:
enum:
- INVALID_ARGUMENT
- OUT_OF_RANGE
examples:
GENERIC_400_INVALID_ARGUMENT:
description: Invalid Argument. Generic Syntax Exception
Expand All @@ -201,7 +211,17 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 401
code:
enum:
- UNAUTHENTICATED
- AUTHENTICATION_REQUIRED
examples:
GENERIC_401_UNAUTHENTICATED:
description: Request cannot be authenticated
Expand All @@ -224,20 +244,23 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 403
code:
enum:
- PERMISSION_DENIED
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action.
GENERIC_403_INVALID_TOKEN_CONTEXT:
description: Reflect some inconsistency between information in some field of the API and the related OAuth2 Token
value:
status: 403
code: INVALID_TOKEN_CONTEXT
message: "{{field}} is not consistent with access token."

Generic404:
description: Not found
Expand All @@ -247,14 +270,17 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 404
code:
enum:
- IDENTIFIER_NOT_FOUND
examples:
GENERIC_404_NOT_FOUND:
description: Resource is not found
value:
status: 404
code: NOT_FOUND
message: The specified resource is not found.
GENERIC_404_IDENTIFIER_NOT_FOUND:
description: The phone number is not associated with a CSP customer account
value:
Expand All @@ -270,7 +296,18 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 422
code:
enum:
- SERVICE_NOT_APPLICABLE
- MISSING_IDENTIFIER
- UNNECESSARY_IDENTIFIER
examples:
GENERIC_422_SERVICE_NOT_APPLICABLE:
description: Service is not applicable for the provided phone number
Expand Down Expand Up @@ -299,7 +336,17 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 429
code:
enum:
- QUOTA_EXCEEDED
- TOO_MANY_REQUESTS
examples:
GENERIC_429_QUOTA_EXCEEDED:
description: Request is rejected due to exceeding a business quota limit
Expand All @@ -322,7 +369,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 500
code:
enum:
- INTERNAL
examples:
GENERIC_500_INTERNAL:
description: Problem in Server side. Regular Server Exception
Expand All @@ -339,7 +395,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 502
code:
enum:
- BAD_GATEWAY
examples:
GENERIC_502_BAD_GATEWAY:
description: Internal routing problem in the Server side that blocks to manage the service properly
Expand All @@ -356,13 +421,22 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 503
code:
enum:
- SERVICE_UNAVAILABLE
examples:
GENERIC_503_UNAVAILABLE:
description: Service is not available. Temporary situation usually related to maintenance process in the server side
value:
status: 503
code: UNAVAILABLE
code: SERVICE_UNAVAILABLE
message: Service Unavailable.

Generic504:
Expand All @@ -373,7 +447,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 504
code:
enum:
- TIMEOUT
examples:
GENERIC_504_TIMEOUT:
description: API Server Timeout
Expand Down

0 comments on commit a710d62

Please sign in to comment.