minimum : Number

minimum

Number

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