Post method with empty requestBody
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023
04:50 PM
01-17-2023
04:50 PM
Post method with empty requestBody
Hello the community
I would like to pick up where this thread left off.
In a Post request, if I don't need any payload in the requestBody ( For example, my inputs are sent within the path or the headers, I would define it as following:
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EmptyBody'
# # # # # #
EmptyBody:
type: object
nullable: true
additionalProperties: false
The idea with additionalProperties: true is that it should comply with data security rules (further details here).
What do you think, folks?
0 REPLIES 0
