Skip to content

Commit 5a614b2

Browse files
committed
Add the "contains" keyword for array instances.
This addresses the enhancement requested in issues #32 and #63. Only the single-schema form from #63 is added here as the multi-schema form did not gather significant support in the absence of a clear use case.
1 parent df8d370 commit 5a614b2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

jsonschema-validation.xml

+11
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,17 @@
367367
</t>
368368
</section>
369369

370+
<section title="contains">
371+
<t>
372+
The value of this keyword MUST be an object. This object MUST be
373+
a valid JSON Schema.
374+
</t>
375+
<t>
376+
An array instance is valid against "contains" if at least one of
377+
its elements is valid against the given schema.
378+
</t>
379+
</section>
380+
370381
<section title="maxProperties">
371382
<t>
372383
The value of this keyword MUST be an integer. This integer MUST be

schema.json

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"type": "boolean",
8888
"default": false
8989
},
90+
"contains": { "$ref": "#" },
9091
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
9192
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
9293
"required": { "$ref": "#/definitions/stringArray" },

0 commit comments

Comments
 (0)