The schema format is not consistent with the type

Description

The format you have specified for one or more numeric schemas is not consistent with the type of the schema. While this is acceptable, it probably is not what you want.

For more details, see the OpenAPI Specification v2 or v3.

Example

The following is an example how this issue could look in your API definition. The array in the schema accepts items of the type integer, but the format float is not an integer format:

{
  "name": "lockCombo",
  "in": "body",
  "description": "Lock combination to add to the list",
  "required": true,
  "schema": {
	"type": "object",
	"required": [
	  "combination"
	],
	"properties": {
	"combination": {
	  "type": "array",
	  "items": {
		"type": "integer",
		"type": "float"
		}
	  }
	}
  }
}

Remediation

Make sure that the formats of all numeric schemas match the type of the schemas.

Numeric schemas type integer can have the format int32 or int64. Numeric schemas type number can have the format float or double.

{
  "name": "lockCombo",
  "in": "body",
  "description": "Lock combination to add to the list",
  "required": true,
  "schema": {
	"type": "object",
	"required": [
	  "combination"
	],
	"properties": {
	"combination": {
	  "type": "array",
	  "items": {
		"type": "integer",
		"type": "int32"
		}
	  }
	}
  }
}

Get API Security news directly in your Inbox.

By clicking Subscribe you agree to our Data Policy