Header parameters have the same name
Issue ID: v3-semantic-parameter-namein-multiple-header
Description
Two or more header parameters have properties name
that are considered equal.
While parameter names normally are case-sensitive, RFC 7230 states that HTTP header names are not. The OpenAPI Specification (OAS) does therefore not consider header parameters names as case-sensitive, so names like content-type
and Content-Type
are considered equal. You should not have equal header parameters in your OpenAPI definition.
For more details, see the OpenAPI Specification.
Example
The following is an example of how this issue could look in your API definition:
{
"parameters": [
{
"name": "Auth-Token",
"in": "header",
"description": "Auth-Token",
"required": true,
"type": "string"
},
{
"name": "auth-token",
"in": "header",
"description": "Authorization token for user",
"required": true,
"type": "string"
}
]
}
Remediation
Make sure that all header parameters have unique name
.
{
"parameters": [
{
"name": "Auth-Token",
"in": "header",
"description": "Auth-Token",
"required": true,
"type": "string"
},
{
"name": "auth-token",
"in": "header",
"description": "Authorization token for user",
"required": true,
"type": "string"
}
]
}