Skip to content

Commit

Permalink
Merge pull request #161 from camaraproject/error-code-align-comm-0.5
Browse files Browse the repository at this point in the history
Align error list & model with comm 0.5
  • Loading branch information
bigludo7 authored Jan 17, 2025
2 parents ab35ebd + f6a0117 commit f0b558b
Showing 1 changed file with 36 additions and 57 deletions.
93 changes: 36 additions & 57 deletions code/API_definitions/number-verification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ info:
# Further info and support
[GSMA Mobile Connect Verified MSISDN specification](https://www.gsma.com/identity/wp-content/uploads/2022/12/IDY.54-Mobile-Connect-Verified-MSISDN-Definition-and-Technical-Requirements-1.0.pdf) was used as source of input for this API. For more about Mobile Connect, please see [Mobile Connect website](https://mobileconnect.io/).
version: 1.0.0
x-camara-commonalities: 0.4.0
version: wip
x-camara-commonalities: 0.5.0
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: '{apiRoot}/number-verification/v1'
- url: '{apiRoot}/number-verification/vwip'
variables:
apiRoot:
default: http://localhost:9091
Expand Down Expand Up @@ -110,12 +110,6 @@ paths:
$ref: '#/components/responses/Generic401'
'403':
$ref: '#/components/responses/PhoneNumberVerificationPermissionDenied403'
'500':
$ref: '#/components/responses/Generic500'
'503':
$ref: '#/components/responses/Generic503'
'504':
$ref: '#/components/responses/Generic504'
security:
- openId:
- number-verification:verify
Expand Down Expand Up @@ -154,12 +148,6 @@ paths:
$ref: '#/components/responses/Generic401'
'403':
$ref: '#/components/responses/PhoneNumberVerificationPermissionDenied403'
'500':
$ref: '#/components/responses/Generic500'
'503':
$ref: '#/components/responses/Generic503'
'504':
$ref: '#/components/responses/Generic504'
security:
- openId:
- number-verification:device-phone-number:read
Expand Down Expand Up @@ -238,7 +226,16 @@ components:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 400
code:
enum:
- INVALID_ARGUMENT
example:
status: 400
code: INVALID_ARGUMENT
Expand All @@ -251,7 +248,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 @@ -277,7 +284,18 @@ components:
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
enum:
- 403
code:
enum:
- PERMISSION_DENIED
- NUMBER_VERIFICATION.USER_NOT_AUTHENTICATED_BY_MOBILE_NETWORK
- INVALID_TOKEN_CONTEXT
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security
Expand All @@ -295,45 +313,6 @@ components:
status: 403
code: INVALID_TOKEN_CONTEXT
message: Phone number cannot be deducted from access token context
Generic500:
description: Server error
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 500
code: INTERNAL
message: Server error
Generic503:
description: Service unavailable. Typically the server is down.
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 503
code: UNAVAILABLE
message: Service unavailable
Generic504:
description: Request time exceeded. If it happens repeatedly, consider reducing the request complexity
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 504
code: TIMEOUT
message: Request timeout exceeded. Try later.
externalDocs:
description: Project documentation at CAMARA
url: https://github.com/camaraproject/NumberVerification

0 comments on commit f0b558b

Please sign in to comment.