exclusiveMinimum : Boolean
exclusiveMinimum
BooleanWhen 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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"minimum": 10,
"exclusiveMinimum": true
}
10.1
11
9.9
9
10.0
10
"100000"
{
"$schema": "http://json-schema.org/draft-04/schema#",
"exclusiveMinimum": true
}
10
-999999999
{
"$schema": "http://json-schema.org/draft-04/schema#",
"minimum": 10,
"exclusiveMinimum": false
}
10
10.0
10.1
9.9