Skip to content

Commit

Permalink
Merge branch 'camaraproject:main' into yamamoto_API-Readiness-Checklist
Browse files Browse the repository at this point in the history
  • Loading branch information
yamamoto0104 authored Jan 2, 2025
2 parents 051e63b + a955ef7 commit 02efd3e
Showing 1 changed file with 222 additions and 35 deletions.
257 changes: 222 additions & 35 deletions code/API_definitions/number-recycling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ components:
application/json:
schema:
$ref: '#/components/schemas/CheckNumRecyclingInfo'

Generic400:
description: Problem with the client request
headers:
Expand All @@ -197,11 +198,31 @@ components:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 400
code: INVALID_ARGUMENT
message: Request body does not comply with the schema
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 400
code:
enum:
- INVALID_ARGUMENT
- OUT_OF_RANGE
examples:
InvalidArgument:
description: Invalid Argument. Generic Syntax Exception
value:
status: 400
code: INVALID_ARGUMENT
message: Client specified an invalid argument, request body or query param.
OutOfRange:
description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested
value:
status: 400
code: OUT_OF_RANGE
message: Client specified an invalid range.

Generic401:
description: Authentication problem with the client request
headers:
Expand All @@ -212,11 +233,31 @@ components:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 401
code: UNAUTHENTICATED
message: Request not authenticated due to missing, invalid, or expired credentials
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 401
code:
enum:
- UNAUTHENTICATED
- AUTHENTICATION_REQUIRED
examples:
Unauthenticated:
description: Request cannot be authenticated
value:
status: 401
code: UNAUTHENTICATED
message: Request not authenticated due to missing, invalid, or expired credentials.
Authentication Required:
description: New authentication is needed, authentication is no longer valid
value:
status: 401
code: AUTHENTICATION_REQUIRED
message: New authentication is required.

Generic403:
description: Client does not have sufficient permission
headers:
Expand All @@ -227,13 +268,24 @@ 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:
PermissionDenied:
Permission Denied:
description: Permission denided. OAuth2 token access 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

Generic404:
description: Resource Not Found
headers:
Expand All @@ -244,11 +296,24 @@ components:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 404
code: NOT_FOUND
message: A specified resource is not found
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 404
code:
enum:
- IDENTIFIER_NOT_FOUND
examples:
Phone Number Used By Different Network Operator:
description: Provided phone number is used by a different network operator
value:
status: 404
code: IDENTIFIER_NOT_FOUND
message: Phone number not found.

Generic422:
description: Unprocessable Content
headers:
Expand All @@ -259,23 +324,70 @@ 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:
DeviceNotApplicable:
Device Not Applicable:
description: Service not applicable for the provided phone number
value:
status: 422
code: DEVICE_NOT_APPLICABLE
code: SERVICE_NOT_APPLICABLE
message: The service is not available for the provided phone number
UnnecessaryIdentifier:
Unnecessary Identifier:
description: An explicit identifier is provided when a phone number has already been identified from the access token
value:
status: 422
code: UNNECESSARY_IDENTIFIER
message: The phone number is already identified by the access token
MissingIdentifier:
Missing Identifier:
value:
status: 422
code: MISSING_IDENTIFIER
message: The phone number cannot be identified

Generic429:
description: Too Many Requests
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 429
code:
enum:
- QUOTA_EXCEEDED
- TOO_MANY_REQUESTS
examples:
Quota Exceeded:
description: Request is rejected due to exceeding a business quota limit
value:
status: 429
code: QUOTA_EXCEEDED
message: Either out of resource quota or reaching rate limiting.
Too Many Requestes:
description: API Server request limit is overpassed
value:
status: 429
code: TOO_MANY_REQUESTS
message: Either out of resource quota or reaching rate limiting.

Generic500:
description: Server error
headers:
Expand All @@ -286,23 +398,98 @@ components:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 500
code: INTERNAL
message: Unknown server error. Typically a server bug.
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 500
code:
enum:
- INTERNAL
examples:
Internal:
description: Problem in Server side. Regular Server Exception
value:
status: 500
code: INTERNAL
message: Unknown server error. Typically a server bug.

Generic502:
description: Bad Gateway
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 502
code:
enum:
- BAD_GATEWAY
examples:
Bad Gateway:
description: Internal routing problem in the Server side that blocks to manage the service properly
value:
status: 502
code: BAD_GATEWAY
message: An upstream internal service cannot be reached.

Generic503:
description: Service unavailable. Typically the server is down.
description: Service Unavailable
headers:
x-correlator:
description: Correlation id for the different services
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
type: string
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 503
code:
enum:
- UNAVAILABLE
examples:
Service Unavailable:
description: Service is not available. Temporary situation usually related to maintenance process in the server side
value:
status: 503
code: UNAVAILABLE
message: Service Unavailable.

Generic504:
description: Gateway Timeout
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 503
code: UNAVAILABLE
message: Service unavailable
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 504
code:
enum:
- TIMEOUT
examples:
Timeout:
description: API Server Timeout
value:
status: 504
code: TIMEOUT
message: Request timeout exceeded.

0 comments on commit 02efd3e

Please sign in to comment.