number and integer types).
multipleOf
Validates that a number is a multiple of a specified value.Syntax
The value must be a number strictly greater than 0.Validation Rules
A numeric instance is valid only if division by themultipleOf value results in an integer.
Examples
Integer Multiples
Decimal Multiples
Even Numbers
minimum
Specifies an inclusive lower bound for a numeric value.Syntax
The value must be a number.Validation Rules
If the instance is a number, it validates only if the value is greater than or equal tominimum.
Examples
maximum
Specifies an inclusive upper bound for a numeric value.Syntax
The value must be a number.Validation Rules
If the instance is a number, it validates only if the value is less than or equal tomaximum.
Examples
exclusiveMinimum
Specifies an exclusive lower bound for a numeric value.Syntax
The value must be a number.Validation Rules
If the instance is a number, it is valid only if the value is strictly greater than (not equal to)exclusiveMinimum.
Examples
exclusiveMaximum
Specifies an exclusive upper bound for a numeric value.Syntax
The value must be a number.Validation Rules
If the instance is a number, it is valid only if the value is strictly less than (not equal to)exclusiveMaximum.
Examples
Combining Numeric Keywords
Multiple numeric validation keywords can be used together to define precise ranges and constraints.Age Range
Percentage
Temperature Range (exclusive bounds)
Price Validation
Score Range
Positive Integer
Open Range
Precision Considerations
JSON Schema allows numbers with arbitrary precision. However, be aware that:- Floating-point arithmetic may introduce rounding errors
- Programming language limitations may affect precision
- When using
multipleOfwith decimal values, consider potential floating-point representation issues