Headers properties should be case insensitive.
See original GitHub issueHTTP Header names are case insensitive. Swagger specification enforce to be case sensitive all field names without exceptions.
All field names in the specification are case sensitive.
Parameter names are case sensitive.
The specification should clarify headers names are case insensitive and must be validated in that way.
So the following schema:
"parameters": [
{
"name": "petId",
"in": "heaer",
"type": "string"
}
]
"headers": {
"X-Rate-Limit-Limit": {
"description": "The number of allowed requests in the current period",
"type": "integer"
}
}
Should be validate these headers as valid headers:
headers: [
"PETID",
"x-rate-limit-limit"
]
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Are HTTP headers case-sensitive? - Stack Overflow
Header names are not case sensitive. From RFC 2616 - "Hypertext Transfer Protocol -- HTTP/1.1", Section 4.2, "Message Headers": Each header field consists ......
Read more >HTTP Headers are Case-Insensitive | Beamtic
While header names are case insensitive according to the HTTP specification, there is little reason to normalize the capitalization of ...
Read more >Are http headers case sensitive? - My Programming Notes
Are http headers case-insensitive? The http header names are case-insensitive. So “Content-Type” is equivalent with “content-type”. Are http ...
Read more >Violating HTTP header case-insensitive standard with "X-Sf ...
POST request with lowercase "x-sf-properties" header.
Read more >HTTP Request Headers attributes are being Case-Sensitive ...
The default behavior of the HTTP Headers is case insensitive, the headers should be accessible within the flow using any case. Attachments.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @jharmn,
Would like to know the conclusion of this discussion. We have the same concern where the java-library in [1] has been used, which is built based on the OpenAPI specification.
As per the Hypertext Transfer Protocol specification in [2] :
As per the OpenAPI specification v3.0 in [3] :
So that the OpenAPI specification not expecting to validate header names, case-sensitively. Rather stating to validate case-insensitively. Please verify.
[1] https://bitbucket.org/atlassian/swagger-request-validator/src/swagger-request-validator-2.3.0/ [2] https://tools.ietf.org/html/rfc2616#section-4.2 [3] https://swagger.io/specification/
Thanks Indunil
I think it should be spec’ed that headers need to be canonicalized. It should at the very least trigger a validation warning by the tools, consistently.