From ae0bcb31ea7e929d90fe46dffe91f63cad40b7d0 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Mon, 16 Dec 2024 13:27:58 +0000 Subject: [PATCH 01/17] Update error response schema for compliance with Commonalities --- code/API_definitions/number-recycling.yaml | 247 ++++++++++++++++++--- 1 file changed, 215 insertions(+), 32 deletions(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index b0bbd16..5b55931 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -187,6 +187,7 @@ components: application/json: schema: $ref: '#/components/schemas/CheckNumRecyclingInfo' + Generic400: description: Problem with the client request headers: @@ -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: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid Argument. Generic Syntax Exception + value: + status: 400 + code: INVALID_ARGUMENT + message: Client specified an invalid argument, request body or query param. + GENERIC_400_OUT_OF_RANGE: + 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: @@ -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: + GENERIC_401_UNAUTHENTICATED: + description: Request cannot be authenticated + value: + status: 401 + code: UNAUTHENTICATED + message: Request not authenticated due to missing, invalid, or expired credentials. + GENERIC_401_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: @@ -227,13 +268,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: PermissionDenied: value: status: 403 code: PERMISSION_DENIED message: Client does not have sufficient permissions to perform this action + Generic404: description: Resource Not Found headers: @@ -243,12 +294,24 @@ components: type: string 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: + GENERIC_404_IDENTIFIER_NOT_FOUND: + description: Provided phone number is not one used by network operator + value: + status: 404 + code: IDENTIFIER_NOT_FOUND + message: Phone number not found. + Generic422: description: Unprocessable Content headers: @@ -259,12 +322,23 @@ 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: value: status: 422 - code: DEVICE_NOT_APPLICABLE + code: SERVICE_NOT_APPLICABLE message: The service is not available for the provided phone number UnnecessaryIdentifier: value: @@ -276,6 +350,40 @@ components: 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: + GENERIC_429_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. + GENERIC_429_TOO_MANY_REQUESTS: + 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: @@ -286,23 +394,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: + GENERIC_500_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: + GENERIC_502_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: + - 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: SERVICE_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: + GENERIC_504_TIMEOUT: + description: API Server Timeout + value: + status: 504 + code: TIMEOUT + message: Request timeout exceeded. From c196ea7eecac6300b45244cf742d2ce9d1bfb978 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Mon, 16 Dec 2024 13:36:19 +0000 Subject: [PATCH 02/17] Update number-recycling.yaml --- code/API_definitions/number-recycling.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index 5b55931..b8d5221 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -294,6 +294,7 @@ components: type: string content: application/json: + schema: allOf: - $ref: "#/components/schemas/ErrorInfo" - type: object From 384c8da3084612c819a09e334171af9c23ff7dea Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Tue, 17 Dec 2024 08:44:34 +0000 Subject: [PATCH 03/17] Update number-recycling.yaml --- code/API_definitions/number-recycling.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index b8d5221..279feda 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -456,13 +456,13 @@ components: - 503 code: enum: - - SERVICE_UNAVAILABLE + - 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: SERVICE_UNAVAILABLE + code: UNAVAILABLE message: Service Unavailable. Generic504: From 7252468583cc859266acecdd420894b3a3e2a452 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:10:38 +0000 Subject: [PATCH 04/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index 279feda..d26ec59 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -245,7 +245,7 @@ components: - UNAUTHENTICATED - AUTHENTICATION_REQUIRED examples: - GENERIC_401_UNAUTHENTICATED: + Unauthenticated: description: Request cannot be authenticated value: status: 401 From 9826a855036c6c6bb23ba2d52d5f8053fd823a20 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:11:13 +0000 Subject: [PATCH 05/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index d26ec59..af1fdb0 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -251,7 +251,7 @@ components: status: 401 code: UNAUTHENTICATED message: Request not authenticated due to missing, invalid, or expired credentials. - GENERIC_401_AUTHENTICATION_REQUIRED: + AuthenticationRequired: description: New authentication is needed, authentication is no longer valid value: status: 401 From 07fbf4b96fb9643ca57f9e1e1d89c64a0e3e57d3 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:11:23 +0000 Subject: [PATCH 06/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index af1fdb0..748d620 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -372,7 +372,7 @@ components: - QUOTA_EXCEEDED - TOO_MANY_REQUESTS examples: - GENERIC_429_QUOTA_EXCEEDED: + QuotaExceeded: description: Request is rejected due to exceeding a business quota limit value: status: 429 From ecadb894f26a8ea00b3d7e93d108bc19e79cbc45 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:11:33 +0000 Subject: [PATCH 07/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index 748d620..b029e05 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -378,7 +378,7 @@ components: status: 429 code: QUOTA_EXCEEDED message: Either out of resource quota or reaching rate limiting. - GENERIC_429_TOO_MANY_REQUESTS: + TooManyRequestes: description: API Server request limit is overpassed value: status: 429 From 8d7e6e7984b8c41e1c71559defedd6c903ef5b2a Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:11:44 +0000 Subject: [PATCH 08/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index b029e05..ad6bac0 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -406,7 +406,7 @@ components: enum: - INTERNAL examples: - GENERIC_500_INTERNAL: + Internal: description: Problem in Server side. Regular Server Exception value: status: 500 From 19a4518ca19556e7d3c0713726b7f2f66394e6e5 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:12:08 +0000 Subject: [PATCH 09/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index ad6bac0..7a1a862 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -432,7 +432,7 @@ components: enum: - BAD_GATEWAY examples: - GENERIC_502_BAD_GATEWAY: + BadGateway: description: Internal routing problem in the Server side that blocks to manage the service properly value: status: 502 From cb7cbceadda5a6904651f0cbefb240e4848cc6fd Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:12:21 +0000 Subject: [PATCH 10/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index 7a1a862..c2092cc 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -458,7 +458,7 @@ components: enum: - UNAVAILABLE examples: - GENERIC_503_UNAVAILABLE: + Unavailable: description: Service is not available. Temporary situation usually related to maintenance process in the server side value: status: 503 From dca9cc914a9d2d3667c264a02e088bb6d15415e6 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:12:55 +0000 Subject: [PATCH 11/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index c2092cc..cfe1b36 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -210,7 +210,7 @@ components: - INVALID_ARGUMENT - OUT_OF_RANGE examples: - GENERIC_400_INVALID_ARGUMENT: + InvalidArgument: description: Invalid Argument. Generic Syntax Exception value: status: 400 From 60afeb59677120e4b7b5b0a8c3241257d89c9cac Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:13:05 +0000 Subject: [PATCH 12/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index cfe1b36..9b41383 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -216,7 +216,7 @@ components: status: 400 code: INVALID_ARGUMENT message: Client specified an invalid argument, request body or query param. - GENERIC_400_OUT_OF_RANGE: + 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 From 23afe12ba4714acf32222bffd221a9b25a1b4d7e Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:13:34 +0000 Subject: [PATCH 13/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index 9b41383..688e141 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -280,6 +280,7 @@ components: - PERMISSION_DENIED examples: PermissionDenied: + description: Permission denided. OAuth2 token access not have the required scope or when the user fails operational security value: status: 403 code: PERMISSION_DENIED From 60f2efd47dcc75341485d71906b09bfd24b7b081 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:13:56 +0000 Subject: [PATCH 14/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index 688e141..0998692 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -338,6 +338,7 @@ components: - UNNECESSARY_IDENTIFIER examples: DeviceNotApplicable: + description: Service not applicable for the provided phone number value: status: 422 code: SERVICE_NOT_APPLICABLE From 31e2ae41e23ac253c6dcec4e7488e73f5e0f3ee1 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:14:09 +0000 Subject: [PATCH 15/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index 0998692..e3e094f 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -344,6 +344,7 @@ components: code: SERVICE_NOT_APPLICABLE message: The service is not available for the provided phone number UnnecessaryIdentifier: + description: An explicit identifier is provided when a phone number has already been identified from the access token value: status: 422 code: UNNECESSARY_IDENTIFIER From f1d29de620641e2f70c825f347fd40cd6781be65 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:14:22 +0000 Subject: [PATCH 16/17] Update code/API_definitions/number-recycling.yaml Co-authored-by: Kenichi Yamamoto --- code/API_definitions/number-recycling.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index e3e094f..2e943c0 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -487,7 +487,7 @@ components: enum: - TIMEOUT examples: - GENERIC_504_TIMEOUT: + Timeout: description: API Server Timeout value: status: 504 From 2b6d8441a8fbeebbe434541bc20ad0b19df9d16a Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Thu, 19 Dec 2024 09:17:24 +0000 Subject: [PATCH 17/17] Update number-recycling.yaml --- code/API_definitions/number-recycling.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/code/API_definitions/number-recycling.yaml b/code/API_definitions/number-recycling.yaml index 2e943c0..48c1d39 100644 --- a/code/API_definitions/number-recycling.yaml +++ b/code/API_definitions/number-recycling.yaml @@ -251,7 +251,7 @@ components: status: 401 code: UNAUTHENTICATED message: Request not authenticated due to missing, invalid, or expired credentials. - AuthenticationRequired: + Authentication Required: description: New authentication is needed, authentication is no longer valid value: status: 401 @@ -279,7 +279,7 @@ components: 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 @@ -307,8 +307,8 @@ components: enum: - IDENTIFIER_NOT_FOUND examples: - GENERIC_404_IDENTIFIER_NOT_FOUND: - description: Provided phone number is not one used by network operator + 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 @@ -337,19 +337,19 @@ components: - MISSING_IDENTIFIER - UNNECESSARY_IDENTIFIER examples: - DeviceNotApplicable: + Device Not Applicable: description: Service not applicable for the provided phone number value: status: 422 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 @@ -375,13 +375,13 @@ components: - QUOTA_EXCEEDED - TOO_MANY_REQUESTS examples: - QuotaExceeded: + 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. - TooManyRequestes: + Too Many Requestes: description: API Server request limit is overpassed value: status: 429 @@ -435,7 +435,7 @@ components: enum: - BAD_GATEWAY examples: - BadGateway: + Bad Gateway: description: Internal routing problem in the Server side that blocks to manage the service properly value: status: 502 @@ -461,7 +461,7 @@ components: enum: - UNAVAILABLE examples: - Unavailable: + Service Unavailable: description: Service is not available. Temporary situation usually related to maintenance process in the server side value: status: 503