minItems : Integer
minItems
IntegerAn array instance is valid if its size is greater than, or equal to, the value of this keyword.
| Value |
This keyword must be set to a zero or positive integer
Hint: Use the jsonschema metaschema and jsonschema lint commands to catch keywords set to invalid values
|
|---|---|
| Kind | Assertion |
| Applies To | Array |
| Base Dialect | Draft 3 |
| Changed In | None |
| Introduced In | Draft 1 |
| Vocabulary | Core |
| Specification | https://json-schema.org/draft-03/draft-zyp-json-schema-03.pdf#5.13 |
| Metaschema | http://json-schema.org/draft-03/schema# |
| Official Tests | draft3/minItems.json |
| Default |
0
|
| Annotation | None |
| Affected By | None |
| Affects | None |
| Also See |
Examples
Schema with 'minItems' keyword
Schema
{
"$schema": "http://json-schema.org/draft-03/schema#",
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
Valid
An array instance with greater than or equal to the minItems value is valid
Instance
["learn"]
Invalid
An array instance with less than the minItems value is invalid
Instance
[]