Header with the name 'Content-Type' is ignored
Issue ID: v3-warning-response-header-content-type
Description
You have used a restricted value as the name of a header. The values Accept
, Content-Type
, and Authorization
are restricted values and should not be used as the header name. A header with any of these values as the header name is ignored.
For more details, see the OpenAPI Specification.
Example
The following is an example of how this issue could look in your API definition:
{
"headers": {
"Content-type": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
}
}
Remediation
Make sure that you do not use the restricted values as header parameter names.
{
"headers": {
"Pet": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
}
}