Integer type

The integer type is a subtype of number type used for validating only integer numbers.

{
  "type": "integer"
}

5 - valid (integer)

-10 - valid (integer)

5.0 - valid (integer)

10.5 - invalid (is float)

"123" - invalid (is string)

null - invalid (is null)

It was added just to simplify the writing of json schemas, because in reality it is just syntactic sugar for number type having the keyword multipleOf set to 1. So the following two schemas are equivalent.

{
  "type": "integer"
}
{
  "type": "number",
  "multipleOf": 1
}

Validation keywords

The integer type supports all keywords that number type supports.