minimum : Number
minimum
NumberValidation succeeds if the numeric instance is greater than or equal to the given number.
Value | This keyword must be set to a number |
---|---|
Kind | Assertion |
Applies To | Number |
Base Dialect | 2020-12 |
Changed In | None |
Introduced In | Draft 1 |
Vocabulary | Validation |
Specification | https://json-schema.org/draft/2020-12/json-schema-validation.html#section-6.2.4 |
Metaschema | https://json-schema.org/draft/2020-12/meta/validation |
Official Tests | draft2020-12/minimum.json |
Default | None |
Annotation | None |
Affected By | None |
Affects | None |
Also See |
|
The minimum
keyword restricts number instances to be greater than or equal to
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
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minimum": 10
}
10.1
11
9.9
9
10.0
10
"100000"
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"minimum": -2.1
}
-2.09
-2
-2.11
-3
-2.1
"100000"