Skip to content

Commit

Permalink
use refs
Browse files Browse the repository at this point in the history
  • Loading branch information
bengreenbank committed Jan 29, 2025
1 parent 15a8c1e commit 6c306e8
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 91 deletions.
15 changes: 2 additions & 13 deletions specs/advanced-personalization/common/responses/BadRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,5 @@ description: Bad request.
content:
application/json:
schema:
title: badRequest
type: object
properties:
status:
type: integer
description: HTTP status code.
enum:
- 400
message:
type: string
description: Details about the response, such as error messages.
enum:
- Invalid request body
- $ref: '../schemas/ErrorResponses.yml#/badRequest'

14 changes: 1 addition & 13 deletions specs/advanced-personalization/common/responses/BadUserID.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@ description: Invalid user ID format.
content:
application/json:
schema:
title: badUserID
type: object
properties:
status:
type: integer
description: HTTP status code.
enum:
- 400
message:
type: string
description: Details about the response, such as error messages.
enum:
- Invalid userID format
- $ref: '../schemas/ErrorResponses.yml#/badUserID'
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@ description: Not found.
content:
application/json:
schema:
title: userNotFound
type: object
properties:
status:
type: integer
description: HTTP status code.
enum:
- 404
message:
type: string
description: Details about the response, such as error messages.
enum:
- Not Found
- $ref: '../schemas/ErrorResponses.yml#/genericNotFound'
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@ description: Unprocessable entity.
content:
application/json:
schema:
title: genericUnprocessableEntity
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:
- Unprocessable Entity
- $ref: '../schemas/ErrorResponses.yml#/genericUnprocessableEntity'
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@ description: Internal server error.
content:
application/json:
schema:
title: internalServerError
type: object
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
- $ref: '../schemas/ErrorResponses.yml#/internalServerError'
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@ description: Invalid user token.
content:
application/json:
schema:
title: invalidUserID
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
- $ref: '../schemas/ErrorResponses.yml#/invalidUserID'
14 changes: 1 addition & 13 deletions specs/advanced-personalization/common/responses/Unauthorized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@ description: Not authorized to access this resource.
content:
application/json:
schema:
title: unauthorized
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
- $ref: '../schemas/ErrorResponses.yml#/unauthorized'
97 changes: 97 additions & 0 deletions specs/advanced-personalization/common/schemas/ErrorResponses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
badRequest:
type: object
properties:
status:
type: integer
description: HTTP status code.
enum:
- 400
message:
type: string
description: Details about the response, such as error messages.
enum:
- Invalid request body

badUserID:
type: object
properties:
status:
type: integer
description: HTTP status code.
enum:
- 400
message:
type: string
description: Details about the response, such as error messages.
enum:
- Invalid userID format

genericNotFound:
type: object
properties:
status:
type: integer
description: HTTP status code.
enum:
- 404
message:
type: string
description: Details about the response, such as error messages.
enum:
- Not Found

genericUnprocessableEntity:
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:
- Unprocessable Entity

internalServerError:
type: object
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

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

unauthorized:
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

0 comments on commit 6c306e8

Please sign in to comment.