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 |
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 is used to set the lower limit on numeric instances. It specifies that the numeric value being validated must be greater than or equal to the provided minimum value.
- Validation succeeds if the number is greater than or equal to the specified
minimum
.
Examples
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "number",
"minimum": 6
}
8.1
4
6
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": [ "null", "number" ],
"minimum": 10.99
}
15
"Hello World!"
null