Skip to content

Commit ac8e207

Browse files
committed
Allow an empty array for "required".
This addresses the enhancement requested in issue #69.
1 parent 4090d4c commit ac8e207

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

jsonschema-validation.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,8 @@
435435

436436
<section title="required">
437437
<t>
438-
The value of this keyword MUST be an array. This array MUST have at
439-
least one element. Elements of this array MUST be strings, and MUST be
440-
unique.
438+
The value of this keyword MUST be an array. Elements of this array
439+
MUST be strings, and MUST be unique.
441440
</t>
442441
<t>
443442
An object instance is valid against this keyword if its

schema.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
"stringArray": {
2222
"type": "array",
2323
"items": { "type": "string" },
24-
"minItems": 1,
2524
"uniqueItems": true
25+
},
26+
"nonEmptyStringArray": {
27+
"allOf": [ { "$ref": "#/definitions/stringArray" }, { "minItems": 1 } ]
2628
}
2729
},
2830
"type": "object",
@@ -118,7 +120,7 @@
118120
"additionalProperties": {
119121
"anyOf": [
120122
{ "$ref": "#" },
121-
{ "$ref": "#/definitions/stringArray" }
123+
{ "$ref": "#/definitions/nonEmptyStringArray" }
122124
]
123125
}
124126
},

0 commit comments

Comments
 (0)