minimum : Number

minimum

Number

Validation 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
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 defining the lower limit of 6 on numeric values Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "number",
  "minimum": 6
}
Valid An instance with a numeric value greater than 6 is valid Instance
8.1
Invalid An instance with a numeric value less than 6 is invalid Instance
4
Valid An instance with a numeric value equal to 6 is valid Instance
6
Schema allowing either a null value or a numeric value with a lower limit of 10.99 Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": [ "null", "number" ],
  "minimum": 10.99
}
Valid An instance with a numeric value greater than or equal to 10.99 is valid Instance
15
Invalid An instance with a string datatype is invalid Instance
"Hello World!"
Valid An instance with a null value is valid Instance
null