Skip to content

Add minContains and maxContains #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jsonschema-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</address>
</author>

<date year="2017"/>
<date year="2018"/>
<workgroup>Internet Engineering Task Force</workgroup>
<keyword>JSON</keyword>
<keyword>Schema</keyword>
Expand Down
2 changes: 1 addition & 1 deletion jsonschema-hyperschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</address>
</author>

<date year="2017" />
<date year="2018" />
<workgroup>Internet Engineering Task Force</workgroup>
<keyword>JSON</keyword>
<keyword>Schema</keyword>
Expand Down
41 changes: 40 additions & 1 deletion jsonschema-validation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</address>
</author>

<date year="2017"/>
<date year="2018"/>
<workgroup>Internet Engineering Task Force</workgroup>
<keyword>JSON</keyword>
<keyword>Schema</keyword>
Expand Down Expand Up @@ -203,6 +203,7 @@
All of the keywords in the <xref target="general">general</xref>,
<xref target="numeric">numeric</xref>, and <xref target="string">string</xref>
sections are assertions, as well as "minItems", "maxItems", "uniqueItems",
"minContains", "maxContains",
"minProperties", "maxProperties", and "required". Additionally, "dependencies"
is shorthand for a combination of conditional and assertion keywords.
</t>
Expand Down Expand Up @@ -575,6 +576,44 @@
its elements is valid against the given schema.
</t>
</section>

<section title="maxContains">
<t>
The value of this keyword MUST be a non-negative integer.
</t>
<t>
An array instance is valid against "maxContains" if the number of
elements that are valid against the schema for "contains" is
less than, or equal to, the value of this keyword.
</t>
<t>
If "contains" is not present within the same schema object,
then this keyword has no effect.
</t>
</section>

<section title="minContains">
<t>
The value of this keyword MUST be a non-negative integer.
</t>
<t>
An array instance is valid against "minContains" if the number of
elements that are valid against the schema for "contains" is
greater than, or equal to, the value of this keyword.
</t>
<t>
A value of 0 is allowed, but is only useful for setting a range
of occurrences from 0 to the value of "maxContains". A value of
0 with no "maxContains" causes "contains" to always pass validation.
</t>
<t>
If "contains" is not present within the same schema object,
then this keyword has no effect.
</t>
<t>
Omitting this keyword has the same behavior as a value of 1.
</t>
</section>
</section>

<section title="Validation Keywords for Objects">
Expand Down
2 changes: 1 addition & 1 deletion relative-json-pointer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</address>
</author>

<date year="2017"/>
<date year="2018"/>
<workgroup>Internet Engineering Task Force</workgroup>
<keyword>JSON</keyword>
<keyword>JavaScript</keyword>
Expand Down