-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Open
Labels
media and encodingIssues regarding media type support and how to encode data (outside of query/path params)Issues regarding media type support and how to encode data (outside of query/path params)question
Description
Hi,
How to express in OpenAPI that a response payload is optional for a given HTTP response code?
I noticed that the keyword "required: true/false" is applicable only to Request Body Object, but not to Response Body Object.
So, if a Response Body Object has a "content" field, does it indicate that a response payload is mandatory, and receiving an empty payload is considered as not allowed?
My goal is to express that a given HTTP response (mainly error codes, 4xx, 5xx) can be sent with, or without response payload. Per RFC 7231, the presence of response payloads in these error codes is encouraged (should) but it's not really mandated.
Thanks!
/Jesús.
sh-at-cs
Metadata
Metadata
Assignees
Labels
media and encodingIssues regarding media type support and how to encode data (outside of query/path params)Issues regarding media type support and how to encode data (outside of query/path params)question