-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: request bodies should take required property into account (#1277)
* fix: request bodies should be optional by default * fix: request body is required by default --------- Co-authored-by: Alfred Jonsson <[email protected]>
- Loading branch information
1 parent
e990899
commit 661a6ad
Showing
5 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
openapi: '3.0.0' | ||
info: | ||
version: 1.0.0 | ||
title: Swagger Petstore | ||
paths: | ||
/pets: | ||
post: | ||
operationId: createPets | ||
requestBody: | ||
$ref: '#/components/requestBodies/RequiredPetBody' | ||
responses: | ||
'204': | ||
description: Ok | ||
put: | ||
operationId: updatePets | ||
requestBody: | ||
$ref: '#/components/requestBodies/OptionalPetBody' | ||
responses: | ||
'204': | ||
description: Ok | ||
/cookies: | ||
post: | ||
operationId: createCookies | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Cookie' | ||
responses: | ||
'204': | ||
description: Ok | ||
put: | ||
operationId: updateCookies | ||
requestBody: | ||
required: false | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Cookie' | ||
responses: | ||
'204': | ||
description: Ok | ||
components: | ||
requestBodies: | ||
OptionalPetBody: | ||
required: false | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
RequiredPetBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
schemas: | ||
Pet: | ||
type: object | ||
Cookie: | ||
type: object |