exclusiveMinimum : Boolean

exclusiveMinimum

Boolean

When minimum is present and this keyword is set to true, the numeric instance must be greater than the value in minimum.

Value This keyword must be set to a boolean value Hint: Use the jsonschema metaschema and jsonschema lint commands to catch keywords set to invalid values
Kind Assertion
Applies To Number
Base Dialect Draft 4
Changed In Draft 6
Introduced In Draft 3
Vocabulary Validation
Specification https://json-schema.org/draft-04/draft-fge-json-schema-validation-00#rfc.section.5.1.3
Metaschema http://json-schema.org/draft-04/schema#
Official Tests draft4/minimum.json
Default false
Annotation None
Affected By None
Affects
Also See

The exclusiveMinimum keyword is a boolean modifier for the minimum keyword. When set to true, it changes the validation behavior of the minimum keyword from greater than or equal to to strictly greater than. This keyword has no effect if the minimum keyword is not present in the same schema.

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 10 (exclusive) Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "minimum": 10,
  "exclusiveMinimum": true
}
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 with exclusive semantics but no lower bound Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "exclusiveMinimum": true
}
Valid Any number value is valid when minimum is not present Instance
10
Valid Any number value is valid when minimum is not present Instance
-999999999
A schema that explicitly constrains number instances to be greater than or equal to 10 Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "minimum": 10,
  "exclusiveMinimum": false
}
Valid The integer value 10 is valid Instance
10
Valid The real representation of the integer value 10 is valid Instance
10.0
Valid A number value greater than 10 is valid Instance
10.1
Invalid A number value less than 10 is invalid Instance
9.9