Schema format is not applicable to the schema's type
Issue ID: warning-schema-format-improper
Description
The format you have specified for a schema is not consistent with the type you have defined for the schema. 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 schema is integer
, but the format is float
which is not an integer format:
{
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "float"
}
}
}
}
Remediation
Make sure that the formats of all schemas match the type of the schemas.
Numeric parameters type integer
can have the format int32
or int64
. Numeric parameters type number
can have the format float
or double
.
{
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
}
}
}
}