Skip to content

Commit

Permalink
feat: update subscription error responses
Browse files Browse the repository at this point in the history
  • Loading branch information
maxl2287 committed Jul 23, 2024
1 parent 92b92a6 commit b816b21
Showing 1 changed file with 46 additions and 110 deletions.
156 changes: 46 additions & 110 deletions code/API_definitions/geofencing-subscriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,9 @@ paths:
"403":
$ref: "#/components/responses/Generic403"
"422":
$ref: "#/components/responses/Generic422"
$ref: "#/components/responses/CreateSubscription422"
"500":
$ref: "#/components/responses/Generic500"
"501":
$ref: "#/components/responses/Generic501"
"502":
$ref: "#/components/responses/Generic502"
"503":
$ref: "#/components/responses/Generic503"
get:
Expand Down Expand Up @@ -218,10 +214,6 @@ paths:
$ref: "#/components/responses/Generic403"
"500":
$ref: "#/components/responses/Generic500"
"501":
$ref: "#/components/responses/Generic501"
"502":
$ref: "#/components/responses/Generic502"
"503":
$ref: "#/components/responses/Generic503"
/subscriptions/{subscriptionId}:
Expand Down Expand Up @@ -257,10 +249,6 @@ paths:
$ref: "#/components/responses/Generic404"
"500":
$ref: "#/components/responses/Generic500"
"501":
$ref: "#/components/responses/Generic501"
"502":
$ref: "#/components/responses/Generic502"
"503":
$ref: "#/components/responses/Generic503"
delete:
Expand Down Expand Up @@ -300,10 +288,6 @@ paths:
$ref: "#/components/responses/Generic404"
"500":
$ref: "#/components/responses/Generic500"
"501":
$ref: "#/components/responses/Generic501"
"502":
$ref: "#/components/responses/Generic502"
"503":
$ref: "#/components/responses/Generic503"
components:
Expand Down Expand Up @@ -1089,22 +1073,22 @@ components:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
INVALID_ARGUMENT:
InvalidArgument:
value:
status: 400
code: INVALID_ARGUMENT
message: Client specified an invalid argument, request body or query param
INVALID_PROTOCOL:
InvalidProtocol:
value:
status: 400
code: INVALID_PROTOCOL
message: Only HTTP is supported
INVALID_CREDENTIAL:
InvalidCredential:
value:
status: 400
code: INVALID_CREDENTIAL
message: Only Access token is supported
INVALID_TOKEN:
InvalidToken:
value:
status: 400
code: INVALID_TOKEN
Expand All @@ -1118,43 +1102,26 @@ components:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
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.
example:
status: 400
code: INVALID_ARGUMENT
message: Client specified an invalid argument, request body or query param
Generic401:
description: Unauthorized
description: Authentication problem with the client request
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
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: Forbidden
example:
value:
status: 401
code: UNAUTHENTICATED
message: Request not authenticated due to missing, invalid, or expired credentials.
CreateSubscription403:
description: Client does not have sufficient permission
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
Expand All @@ -1163,18 +1130,29 @@ components:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security
PermissionDenied:
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
message: Client does not have sufficient permissions to perform this action
TokenMismatch:
value:
status: 403
code: INVALID_TOKEN_CONTEXT
message: "{{field}} is not consistent with access token."
code: SUBSCRIPTION_MISMATCH
message: Inconsistent access token for requested events subscription
Generic403:
description: Forbidden
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform this action
Generic404:
description: Not found
headers:
Expand All @@ -1191,8 +1169,8 @@ components:
status: 404
code: NOT_FOUND
message: The specified resource is not found.
Generic422:
description: Unprocessable Content
CreateSubscription422:
description: Unprocessable Entity
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
Expand All @@ -1201,68 +1179,26 @@ components:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
GENERIC_422_DEVICE_IDENTIFIERS_MISMATCH:
description: Inconsistency between device identifiers not pointing to the same device
value:
status: 422
code: DEVICE_IDENTIFIERS_MISMATCH
message: Provided device identifiers are not consistent.
GENERIC_422_DEVICE_NOT_APPLICABLE:
description: Service is not available for the provided device
PermissionDenied:
value:
status: 422
code: DEVICE_NOT_APPLICABLE
message: The service is not available for the provided device.
code: MULTIEVENT_SUBSCRIPTION_NOT_SUPPORTED
message: Multi event types subscription not managed
Generic500:
description: Internal Server Error
description: Server error
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
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.
Generic501:
description: Not Implemented
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
GENERIC_501_NOT_IMPLEMENTED:
description: Service not implemented. The use of this code should be avoided as far as possible to get the objective to reach aligned implementations
value:
status: 501
code: NOT_IMPLEMENTED
message: This functionality is not implemented yet.
Generic502:
description: Bad Gateway
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
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.
example:
status: 500
code: INTERNAL
message: Server error
Generic503:
description: Service Unavailable
description: Service unavailable. Typically the server is down.
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
Expand Down

0 comments on commit b816b21

Please sign in to comment.