Skip to content

Commit

Permalink
Update qod-api.yaml
Browse files Browse the repository at this point in the history
Schemas for GenericXXX responses must restrict the ErrorInfo model to the allowed values at `status`  and `code` for  every specific response
  • Loading branch information
jlurien committed Jan 26, 2023
1 parent 4050c21 commit c43b46b
Showing 1 changed file with 60 additions and 6 deletions.
66 changes: 60 additions & 6 deletions code/API_definitions/qod-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
type: string
enum: ["400"]
code:
type: string
enum: ["INVALID_INPUT"]
example:
status: "400"
code: INVALID_INPUT
Expand All @@ -447,7 +456,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
type: string
enum: ["401"]
code:
type: string
enum: ["UNAUTHORIZED"]
example:
status: "401"
code: UNAUTHORIZED
Expand All @@ -457,7 +475,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
type: string
enum: ["403"]
code:
type: string
enum: ["FORBIDDEN"]
example:
status: "403"
code: FORBIDDEN
Expand All @@ -467,7 +494,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
type: string
enum: ["404"]
code:
type: string
enum: ["NOT_FOUND"]
example:
status: "404"
code: NOT_FOUND
Expand All @@ -477,7 +513,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
type: string
enum: ["500"]
code:
type: string
enum: ["INTERNAL"]
example:
status: "500"
code: INTERNAL
Expand All @@ -487,7 +532,16 @@ components:
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
allOf:
- $ref: "#/components/schemas/ErrorInfo"
- type: object
properties:
status:
type: string
enum: ["503"]
code:
type: string
enum: ["SERVICE_UNAVAILABLE"]
example:
status: "503"
code: SERVICE_UNAVAILABLE
Expand Down

0 comments on commit c43b46b

Please sign in to comment.