Skip to content

Commit f3130e6

Browse files
authored
fix(petstore): Update petstore to conform with OpenAPI 3.0.3 spec
The petstore YAML is not consistent with the OpenAPI schema 3.0.2 and 3.0.3 as it uses HTTP response code 405 incorrectly (OAI/OpenAPI-Specification#1486)
1 parent 67ab72f commit f3130e6

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/plugins/default-definitions/index.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ paths:
7272
description: Invalid ID supplied
7373
'404':
7474
description: Pet not found
75-
'405':
75+
'422':
7676
description: Validation exception
7777
security:
7878
- petstore_auth:
@@ -107,7 +107,9 @@ paths:
107107
application/xml:
108108
schema:
109109
$ref: '#/components/schemas/Pet'
110-
'405':
110+
'400':
111+
description: Invalid body format
112+
'422':
111113
description: Invalid input
112114
security:
113115
- petstore_auth:
@@ -249,7 +251,7 @@ paths:
249251
schema:
250252
type: string
251253
responses:
252-
'405':
254+
'400':
253255
description: Invalid input
254256
security:
255257
- petstore_auth:
@@ -364,7 +366,9 @@ paths:
364366
application/json:
365367
schema:
366368
$ref: '#/components/schemas/Order'
367-
'405':
369+
'400':
370+
description: Invalid body format
371+
'422':
368372
description: Invalid input
369373
/store/order/{orderId}:
370374
get:
@@ -855,8 +859,10 @@ paths:
855859
schema:
856860
$ref: "#/definitions/Pet"
857861
responses:
858-
"405":
859-
description: "Invalid input"
862+
"400":
863+
description: Invalid body format
864+
"422":
865+
description: Invalid input
860866
security:
861867
- petstore_auth:
862868
- "write:pets"
@@ -885,7 +891,7 @@ paths:
885891
description: "Invalid ID supplied"
886892
"404":
887893
description: "Pet not found"
888-
"405":
894+
"422":
889895
description: "Validation exception"
890896
security:
891897
- petstore_auth:
@@ -1019,8 +1025,10 @@ paths:
10191025
required: false
10201026
type: "string"
10211027
responses:
1022-
"405":
1023-
description: "Invalid input"
1028+
"400":
1029+
description: Invalid body format
1030+
"422":
1031+
description: Invalid input
10241032
security:
10251033
- petstore_auth:
10261034
- "write:pets"

0 commit comments

Comments
 (0)