Skip to content

Commit

Permalink
Add the "contains" keyword for array instances.
Browse files Browse the repository at this point in the history
This addresses the enhancement requested in issues json-schema-org#32 and json-schema-org#63.
Only the single-schema form from json-schema-org#63 is added here as the multi-schema form
did not gather significant support in the absence of a clear use case.
  • Loading branch information
handrews committed Oct 28, 2016
1 parent df8d370 commit 5a614b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jsonschema-validation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,17 @@
</t>
</section>

<section title="contains">
<t>
The value of this keyword MUST be an object. This object MUST be
a valid JSON Schema.
</t>
<t>
An array instance is valid against "contains" if at least one of
its elements is valid against the given schema.
</t>
</section>

<section title="maxProperties">
<t>
The value of this keyword MUST be an integer. This integer MUST be
Expand Down
1 change: 1 addition & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"type": "boolean",
"default": false
},
"contains": { "$ref": "#" },
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
"required": { "$ref": "#/definitions/stringArray" },
Expand Down

0 comments on commit 5a614b2

Please sign in to comment.