exclusiveMinimum : Number

exclusiveMinimum

Number

Validation succeeds if the numeric instance is greater than the given number.

Value This keyword must be set to a number
Kind Assertion
Applies To Number
Base Dialect 2020-12
Changed In Draft 6
Introduced In Draft 3
Vocabulary Validation
Specification https://json-schema.org/draft/2020-12/json-schema-validation.html#section-6.2.5
Metaschema https://json-schema.org/draft/2020-12/meta/validation
Official Tests draft2020-12/exclusiveMinimum.json
Default None
Annotation None
Affected By None
Affects None
Also See

The exclusiveMinimum keyword restricts number instances to be strictly greater than the given number.

Remember that JSON Schema is a constraint-driven language. Therefore, non-number instances successfully validate against this keyword. If needed, make use of the type keyword to constraint the accepted type accordingly.

Examples

A schema that constrains number instances to be greater than the positive integer 10 Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "exclusiveMinimum": 10
}
Valid A number value greater than 10 is valid Instance
10.1
Valid An integer value greater than 10 is valid Instance
11
Invalid A number value less than 10 is invalid Instance
9.9
Invalid An integer value less than 10 is invalid Instance
9
Invalid The real representation of the integer value 10 is invalid Instance
10.0
Invalid The integer value 10 is invalid Instance
10
Valid A non-number value is valid Instance
"100000"
A schema that constrains number instances to be greater than the negative real number -2.1 Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "exclusiveMinimum": -2.1
}
Valid A number value greater than -2.1 is valid Instance
-2.09
Valid An integer value greater than -2.1 is valid Instance
-2
Invalid A number value less than -2.1 is invalid Instance
-2.11
Invalid An integer value less than -2.1 is invalid Instance
-3
Invalid The real number value -2.1 is invalid Instance
-2.1
Valid A non-number value is valid Instance
"100000"