-
Notifications
You must be signed in to change notification settings - Fork 9.2k
v3.1.2: Clarify how to describe no response content #4611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We decided that the lack of `content` doesn't guarantee a lack of response content, but that noting a `Content-Length` of `0` does.
I'm a little uncertain on this because the HTTP spec is very squirrelly around |
``` | ||
|
||
Response with no return value: | ||
A response with no return value can be specified by omitting the `content` field, although this technically does not enforce a lack of content, it merely indicates that none is documented: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"no return value" is not very clear (some might say a response's "return value" is its HTTP response code) -- we should say "with no message body", or perhaps "zero length response body".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karenetheridge good catch- let me think on how to frame this more clearly.
@karenetheridge I'm starting to question this entire approach. I know that we generally say that OADs are not comprehensive, and something that is not documented is not necessarily excluded (paging @mikekistler, @earth2marsh ). But by this logic, having a Response Object that only documents So I think that the original advice to just omit And if that is the case, then I feel like getting into the use of I'm moving this to draft to indicate that I don't think it's ready for merge. |
Sure, leaving out But what about server implementers, if they want to verify that there is definitely no message body? That's a valid usecase (at $lastjob, I built exactly such a thing into the test framework for a server application), and it would be nice for there to be a way to signal "if there is a message body, then this is invalid". But yes, this doesn't have to go into the spec. I think we have an issue/discussion somewhere discussing a set of docs that would act as a cookbook? I might be thinking of JSON Schema. |
@karenetheridge the use case is definitely valid! It's just that (as you note) this doesn't have to go in the spec to be usable, and the fact that To really enforce it, we'd need to add some sort of additional field, which would mean 3.2/3.3. It sounds to me like you're OK with closing this, though? It is a 100% valid use case, I just don't think this is clear and reliable enough to go into the spec. |
Closing in favor of OAI/learn.openapis.org#132. |
Fixes #3536.
We decided that the lack of
content
doesn't guarantee a lack of response content, but that noting aContent-Length
of0
does. @karenetheridge pointed out that we can set theContent-Length
header to clarify this.