minimum : Number
minimum
NumberValidation succeeds if the numeric instance is greater than or equal to the given number.
Kind | Assertion |
---|---|
Applies To | Number |
Dialect | 2020-12 |
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 |
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.
- Applies only to number data types (integers and floats).
- 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