Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ description: Bad request.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
$ref: '../schemas/ErrorResponses.yml#/badRequest'

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Bad user ID.
content:
application/json:
schema:
$ref: '../schemas/ErrorResponses.yml#/badUserID'

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Not found.
content:
application/json:
schema:
$ref: '../schemas/ErrorResponses.yml#/genericNotFound'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Unprocessable entity.
content:
application/json:
schema:
$ref: '../schemas/ErrorResponses.yml#/genericUnprocessableEntity'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ description: Internal server error.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
$ref: '../schemas/ErrorResponses.yml#/internalServerError'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ description: Invalid user ID format.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
$ref: '../schemas/ErrorResponses.yml#/invalidUserID'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ description: Not authorized to access this resource.
content:
application/json:
schema:
$ref: './BaseResponse.yml'
$ref: '../schemas/ErrorResponses.yml#/unauthorized'

This file was deleted.

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
24 changes: 24 additions & 0 deletions specs/advanced-personalization/common/schemas/ErrorCodes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
badRequest:
type: integer
description: HTTP status code for a bad request error.
enum: [400]

unauthorized:
type: integer
description: HTTP status code for an authorization error.
enum: [401]

notFound:
type: integer
description: HTTP status code for a not found error.
enum: [404]

unprocessableEntity:
type: integer
description: HTTP status code for an unprocessable entity error.
enum: [422]

internalServerError:
type: integer
description: HTTP status code for an internal server error.
enum: [500]
36 changes: 36 additions & 0 deletions specs/advanced-personalization/common/schemas/ErrorMessages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
badRequest:
type: string
description: Details about the response, such as error messages.
enum: [Invalid request body]

badUserID:
type: string
description: Details about the response, such as error messages.
enum: [Invalid userID format]

unauthorized:
type: string
description: Details about the response, such as error messages.
enum: [Unauthorized]

genericNotFound:
type: string
description: Details about the response, such as error messages.
enum: [Not Found]

genericUnprocessableEntity:
type: string
description: Details about the response, such as error messages.
enum: [Unprocessable Entity]

invalidUserID:
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]

internalServerError:
type: string
description: Details about the response, such as error messages.
enum: [Internal Server Error]


Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
badRequest:
type: object
properties:
status:
$ref: './ErrorCodes.yml#/badRequest'
message:
$ref: './ErrorMessages.yml#/badRequest'

badUserID:
type: object
properties:
status:
$ref: './ErrorCodes.yml#/badRequest'
message:
$ref: './ErrorMessages.yml#/badUserID'

unauthorized:
type: object
properties:
status:
$ref: './ErrorCodes.yml#/unauthorized'
message:
$ref: './ErrorMessages.yml#/unauthorized'

genericNotFound:
type: object
properties:
status:
$ref: './ErrorCodes.yml#/notFound'
message:
$ref: './ErrorMessages.yml#/genericNotFound'

genericUnprocessableEntity:
type: object
properties:
status:
$ref: './ErrorCodes.yml#/unprocessableEntity'
message:
$ref: './ErrorMessages.yml#/genericUnprocessableEntity'

invalidUserID:
type: object
properties:
status:
$ref: './ErrorCodes.yml#/unprocessableEntity'
message:
$ref: './ErrorMessages.yml#/invalidUserID'

internalServerError:
type: object
properties:
status:
$ref: './ErrorCodes.yml#/internalServerError'
message:
$ref: './ErrorMessages.yml#/internalServerError'
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
8 changes: 3 additions & 5 deletions specs/advanced-personalization/paths/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ 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':
$ref: '../common/responses/UserNotFound.yml'
$ref: '../common/responses/GenericNotFound.yml'
'422':
$ref: '../common/responses/InvalidUserID.yml'
'500':
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'