Skip to content

Commit d129ed4

Browse files
committed
Allow empty "required" and "dependencies" arrays.
This addresses the enhancement requested in issue json-schema-org#69. The "requirements" and "dependencies" string arrays should be allowed to be empty, with the same effect as not being present.
1 parent 4090d4c commit d129ed4

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

jsonschema-validation.xml

+5-6
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+
if any, MUST be strings, and MUST be unique.
441440
</t>
442441
<t>
443442
An object instance is valid against this keyword if its
@@ -525,9 +524,9 @@
525524
against the entire instance.
526525
</t>
527526
<t>
528-
If the dependency value is an array, it MUST have at least one element, each
529-
element MUST be a string, and elements in the array MUST be unique. If the
530-
dependency key is a property in the instance, each of the items in the dependency
527+
If the dependency value is an array, each element in the array,
528+
if any, MUST be a string, and MUST be unique. If the dependency key is
529+
a property in the instance, each of the items in the dependency
531530
value must be a property that exists in the instance.
532531
</t>
533532
</section>

schema.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"stringArray": {
2222
"type": "array",
2323
"items": { "type": "string" },
24-
"minItems": 1,
2524
"uniqueItems": true
2625
}
2726
},

0 commit comments

Comments
 (0)