exclusiveMaximum : Boolean
exclusiveMaximum
BooleanWhen maximum is present and this keyword is set to true, the numeric instance must be less than the value in maximum.
| 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.2 |
| Metaschema | http://json-schema.org/draft-04/schema# |
| Official Tests | draft4/maximum.json |
| Default |
false
|
| Annotation | None |
| Affected By | None |
| Affects |
|
| Also See |
|
The exclusiveMaximum
keyword is a boolean modifier for the maximum keyword. When set to true, it changes the
validation behavior of the maximum
keyword from less than or equal to to strictly less than. This keyword has
no effect if the maximum 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#",
"maximum": 10,
"exclusiveMaximum": true
}9.9910.0011110.010"100000"{
"$schema": "http://json-schema.org/draft-04/schema#",
"exclusiveMaximum": true
}10999999999{
"$schema": "http://json-schema.org/draft-04/schema#",
"maximum": 10,
"exclusiveMaximum": false
}1010.09.910.1