-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Clarify if header is required to be sent in the response #321
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
Comments
IMO should be addressed as REQUIRED |
That's an interesting and fair question. I'll have to dig into the discussions about it to see if we mentioned anything specific about it. However, even the first definition doesn't necessarily mean it is required, but rather suggested. Normally, when something is required, the term |
The argument which I think MUST be REQUIRED is that the header is linked to the response HTTP Code. So it's specific enough to assume these headers will be received always for this HTTP Code. |
I'm not disagreeing, but if the intent wasn't clarified originally, I may not be able to clarify it in this version of the spec as well. The current wording implies OPTIONAL over REQUIRED, but as said, I'll look into it. |
What about a required=true attribute in the headers object definition? I think it strongly depends on each headers type. |
I only suggest when possible use the same validation rules as JSON-Schema. |
Wasn't aware of the JSON-Schema compliance, but any property indicating the requirement would be great as well. |
Say, minLength=1 when required ? http://json-schema.org/latest/json-schema-validation.html#anchor25 |
|
Totally agree with @nfroidure proposal (add a required property in header object). |
Parent: #560 |
The Header Object now follows a similar pattern to the Parameter Object and contains a |
@webron, https://swagger.io/specification/v2/ does not show that the |
In the currently spec, a |
Given the headers section has a definition for a given header (let's say ETag) the question is:
Is the header required to be present in the response sent by the server?
Reading the first definition I understand that is REQUIRED.
Reading the second definition I understand that is OPTIONAL.
Spec should be rephrased clarifying this aspect.
The text was updated successfully, but these errors were encountered: