Parameter format is not applicable to the parameter's type
Issue ID: warning-parameter-format-improper
Description
The format you have specified for a parameter is not consistent with the type you have defined for the parameter. 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 type of the parameter is integer
, but the format is float
which is not an integer format:
{
"parameters": {
"type": "integer",
"name": "total",
"in": "query",
"format": "float",
"description": "Number of the objects in the array."
}
}
Remediation
Make sure that the formats of all parameters match the type of the parameters.
Numeric parameters type integer
can have the format int32
or int64
. Numeric parameters type number
can have the format float
or double
.
{
"parameters": {
"type": "integer",
"name": "total",
"in": "query",
"format": "int32",
"description": "Number of the objects in the array."
}
}