Header format is not applicable to the header's type
Issue ID: warning-header-format-improper
Description
The format you have specified for a header is not consistent with the type you have defined. While this is acceptable, it may not be what you want.
For more details, see the OpenAPI Specification and JSON Schema Validation.
Example
The following is an example of how this issue could look in your API definition. The header type is integer, but format is float which is not an integer format:
{
"responses": {
"200": {
"description": "OK",
"headers": {
"x-ids": {
"schema": {
"type": "integer",
"format": "float"
}
}
}
}
}
}
Remediation
Make sure that the formats of all headers match the type of the headers.
Numeric parameters type integer
can have the format int32
or int64
. Numeric parameters type number
can have the format float
or double
.
{
"responses": {
"200": {
"description": "OK",
"headers": {
"x-ids": {
"schema": {
"type": "integer",
"format": "int32"
}
}
}
}
}
}