-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Response without body, description? #381
Comments
Add an empty body. |
@YamiOdymel Thank you sir! Would be awesome to be able avoid such hacks though IMO. |
Strictly speaking, an empty body is not a valid JSON. I use |
@FranklinYu Empty string is not a valid body for JSON indeed. Strictly speaking, But, in the issue we are talking about JSON API which allows empty bodies. JSON API utilizes JSON for non empty bodies, but it's NOT JSON. It's scope is wider than just data serialization format. UPDATE: Somehow information on |
@ixti I have heard of the JSON API but not familiar with it; I skimmed through its specification but didn't find keywords like "empty body". |
@FranklinYu Take a look on responses description:
More than that. You SHOULD NOT send body with 204 response according to HTTP specs as well. |
For empty body in that case, I prefer not to specify content type at all. Clients should not depend on content type in "204 No Content" response. I think I'm getting off topic… |
I'm trying to set a description to a response that does not send a body:
Isn't working:
This works though:
The text was updated successfully, but these errors were encountered: