Skip to content

Commit

Permalink
detail error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
bengreenbank committed Jan 29, 2025
1 parent 8e10eeb commit 6144c4a
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 27 deletions.
11 changes: 10 additions & 1 deletion specs/advanced-personalization/common/responses/BadRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@ description: Bad request.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
type: object

Check failure on line 5 in specs/advanced-personalization/common/responses/BadRequest.yml

View workflow job for this annotation

GitHub Actions / specs

title must be set in inline models
properties:
status:

Check failure on line 7 in specs/advanced-personalization/common/responses/BadRequest.yml

View workflow job for this annotation

GitHub Actions / specs

enum must be out of line
type: integer
description: HTTP status code.
enum: [400]
message:

Check failure on line 11 in specs/advanced-personalization/common/responses/BadRequest.yml

View workflow job for this annotation

GitHub Actions / specs

enum must be out of line
type: string
description: Details about the response, such as error messages.
enum: ["Invalid request body"]
14 changes: 14 additions & 0 deletions specs/advanced-personalization/common/responses/BadUserID.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: Invalid user ID format.
content:
application/json:
schema:
type: object

Check failure on line 5 in specs/advanced-personalization/common/responses/BadUserID.yml

View workflow job for this annotation

GitHub Actions / specs

title must be set in inline models
properties:
status:

Check failure on line 7 in specs/advanced-personalization/common/responses/BadUserID.yml

View workflow job for this annotation

GitHub Actions / specs

enum must be out of line
type: integer
description: HTTP status code.
enum: [400]
message:

Check failure on line 11 in specs/advanced-personalization/common/responses/BadUserID.yml

View workflow job for this annotation

GitHub Actions / specs

enum must be out of line
type: string
description: Details about the response, such as error messages.
enum: ["Invalid userID format"]

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: Unprocessable entity.
content:
application/json:
schema:
type: object

Check failure on line 5 in specs/advanced-personalization/common/responses/GenericUnprocessableEntity.yml

View workflow job for this annotation

GitHub Actions / specs

title must be set in inline models
properties:
status:

Check failure on line 7 in specs/advanced-personalization/common/responses/GenericUnprocessableEntity.yml

View workflow job for this annotation

GitHub Actions / specs

enum must be out of line
type: integer
description: HTTP status code.
enum: [422]
message:

Check failure on line 11 in specs/advanced-personalization/common/responses/GenericUnprocessableEntity.yml

View workflow job for this annotation

GitHub Actions / specs

enum must be out of line
type: string
description: Details about the response, such as error messages.
enum: ["Unprocessable Entity"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@ description: Internal server error.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
type: object

Check failure on line 5 in specs/advanced-personalization/common/responses/InternalServerError.yml

View workflow job for this annotation

GitHub Actions / specs

title must be set in inline models
properties:
status:
type: integer
description: HTTP status code.
enum: [500]
message:
type: string
description: Details about the response, such as error messages.
enum: ["Internal Server Error"]
13 changes: 11 additions & 2 deletions specs/advanced-personalization/common/responses/InvalidUserID.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
description: Invalid user ID format.
description: Invalid user token.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
type: object
properties:
status:
type: integer
description: HTTP status code.
enum: [422]
message:
type: string
description: Details about the response, such as error messages.
enum: ["UserID must contain only alphanumeric, equal, plus, slash, hyphen, or underscore characters, and be between 1 and 129 characters long"]
11 changes: 10 additions & 1 deletion specs/advanced-personalization/common/responses/Unauthorized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@ description: Not authorized to access this resource.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
type: object
properties:
status:
type: integer
description: HTTP status code.
enum: [401]
message:
type: string
description: Details about the response, such as error messages.
enum: ["Unauthorized"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@ description: User not found.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
status:
type: integer
description: HTTP status code.
enum: [404]
message:
type: string
description: Details about the response, such as error messages.
enum: ["Not Found"]
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ status:
type: array
items:
$ref: '../enums.yml#/errorCodes'
lastUpdatedAt:
type: string
2 changes: 0 additions & 2 deletions specs/advanced-personalization/paths/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ get:
$ref: '../common/schemas/ConfigurationObject.yml#/configurationObject'
'401':
$ref: '../common/responses/Unauthorized.yml'
'404':
$ref: '../common/responses/ConfigurationNotFound.yml'
'500':
$ref: '../common/responses/InternalServerError.yml'

Expand Down
6 changes: 2 additions & 4 deletions specs/advanced-personalization/paths/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ get:
schema:
$ref: '../common/schemas/User.yml#/user'
'400':
$ref: '../common/responses/BadRequest.yml'
$ref: '../common/responses/BadUserID.yml'
'401':
$ref: '../common/responses/Unauthorized.yml'
'404':
Expand Down Expand Up @@ -60,11 +60,9 @@ delete:
deletedAt:
type: string
'400':
$ref: '../common/responses/BadRequest.yml'
$ref: '../common/responses/BadUserID.yml'
'401':
$ref: '../common/responses/Unauthorized.yml'
'404':
$ref: '../common/responses/UserNotFound.yml'
'422':
$ref: '../common/responses/InvalidUserID.yml'
'500':
Expand Down
4 changes: 2 additions & 2 deletions specs/advanced-personalization/paths/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ get:
nextPageToken:
type: string
required: [users]
'400':
$ref: '../common/responses/BadRequest.yml'
'401':
$ref: '../common/responses/Unauthorized.yml'
'422':
$ref: '../common/responses/GenericUnprocessableEntity.yml'
'500':
$ref: '../common/responses/InternalServerError.yml'

0 comments on commit 6144c4a

Please sign in to comment.