From f856f177fef9ccef1dbeba48401d7186ae5710a3 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Wed, 27 Dec 2017 16:11:31 -0800 Subject: [PATCH 1/3] Add minContains and maxContains --- jsonschema-validation.xml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 356098fc..f171fa46 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -203,6 +203,7 @@ All of the keywords in the general, numeric, and string 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. @@ -575,6 +576,39 @@ its elements is valid against the given schema. + +
+ + The value of this keyword MUST be a non-negative integer. + + + 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. + + + If "contains" is not present within the same schema object, + then this keyword has no effect. + +
+ +
+ + The value of this keyword MUST be a non-negative integer. + + + 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. + + + If "contains" is not present within the same schema object, + then this keyword has no effect. + + + Omitting this keyword has the same behavior as a value of 1. + +
From 94eebdc4debba9dd4dc200a2a187481a5ac835e4 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Tue, 9 Jan 2018 14:38:55 -0800 Subject: [PATCH 2/3] Add guidance on "minContains": 0 This value is only useful when "maxContains" is present. --- jsonschema-validation.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index f171fa46..17efb2ba 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -601,6 +601,11 @@ elements that are valid against the schema for "contains" is greater than, or equal to, the value of this keyword. + + 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. + If "contains" is not present within the same schema object, then this keyword has no effect. From ccf75dd1750a224ec636a43b284356073aa0e7f1 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Tue, 9 Jan 2018 14:40:02 -0800 Subject: [PATCH 3/3] Happy New Year! (change year to 2018) --- jsonschema-core.xml | 2 +- jsonschema-hyperschema.xml | 2 +- jsonschema-validation.xml | 2 +- relative-json-pointer.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jsonschema-core.xml b/jsonschema-core.xml index de568037..61741cde 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -42,7 +42,7 @@ - + Internet Engineering Task Force JSON Schema diff --git a/jsonschema-hyperschema.xml b/jsonschema-hyperschema.xml index a0bdee14..c60d41ed 100644 --- a/jsonschema-hyperschema.xml +++ b/jsonschema-hyperschema.xml @@ -49,7 +49,7 @@ - + Internet Engineering Task Force JSON Schema diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index 17efb2ba..405dc63f 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -62,7 +62,7 @@ - + Internet Engineering Task Force JSON Schema diff --git a/relative-json-pointer.xml b/relative-json-pointer.xml index 1e5f9a17..e56278b4 100644 --- a/relative-json-pointer.xml +++ b/relative-json-pointer.xml @@ -40,7 +40,7 @@ - + Internet Engineering Task Force JSON JavaScript