diff --git a/jsonschema-core.xml b/jsonschema-core.xml index e6b5476e..05712f2c 100644 --- a/jsonschema-core.xml +++ b/jsonschema-core.xml @@ -2330,32 +2330,6 @@ Implementations that do not support annotation collection MUST do so. - -
- - The value of this keyword MUST be a valid JSON Schema. - - - An array instance is valid against "contains" if at least one of - its elements is valid against the given schema. The subschema MUST be - applied to every array element even after the first match has - been found, in order to collect annotations for use by other keywords. - This is to ensure that all possible annotations are collected. - - - Logically, the validation result of applying the value subschema to each - item in the array MUST be ORed with "false", resulting in an overall - validation result. - - - This keyword produces an annotation value which is an array of - the indexes to which this keyword validates successfully when applying - its subschema, in ascending order. The value MAY be a boolean "true" if - the subschema validates successfully when applied to every index of the - instance. The annotation MUST be present if the instance array to which - this keyword's schema applies is empty. - -
@@ -2450,6 +2424,42 @@
+ +
+
+ + The value of this keyword MUST be a valid JSON Schema. + + + An array instance is valid against "contains" if at least one of + its elements is valid against the given schema. The subschema MUST be + applied to every array element even after the first match has + been found, in order to collect annotations for use by other keywords. + This is to ensure that all possible annotations are collected. + + + An object instance is valid against "contains" if at least one of + its property values is valid against the given schema. The subschema + MUST be applied to every property value even after the first match has + been found, in order to collect annotations for use by other keywords. + This is to ensure that all possible annotations are collected. + + + Logically, the validation result of applying the value subschema to each + item in the array or property in the object MUST be ORed with "false", + resulting in an overall validation result. + + + This keyword produces an annotation value which is an array of the + indexes or property names to which this keyword validates successfully + when applying its subschema, in ascending order. The value MAY be a + boolean "true" if the subschema validates successfully when applied to + every index or property value of the instance. The annotation MUST be + present if the instance array or object to which this keyword's schema + applies is empty. + +
+
@@ -3841,6 +3851,11 @@ https://example.com/schemas/common#/$defs/count/minimum + + + "contains" now applies to objects as well as arrays + + "$schema" MAY change for embedded resources diff --git a/jsonschema-validation.xml b/jsonschema-validation.xml index b8d68d69..e1990bcd 100644 --- a/jsonschema-validation.xml +++ b/jsonschema-validation.xml @@ -410,13 +410,13 @@ then this keyword has no effect. - An instance array is valid against "maxContains" in two ways, depending on - the form of the annotation result of an adjacent + An instance array or object is valid against "maxContains" in two ways, + depending on the form of the annotation result of an adjacent "contains" keyword. The first way is if the annotation result is an array and the length of that array is less than or equal to the "maxContains" value. The second way is if the annotation - result is a boolean "true" and the instance array length is less than or - equal to the "maxContains" value. + result is a boolean "true" and the instance length (number of items or + properties) is less than or equal to the "maxContains" value. @@ -429,13 +429,13 @@ then this keyword has no effect. - An instance array is valid against "minContains" in two ways, depending on - the form of the annotation result of an adjacent + An instance array or object is valid against "minContains" in two ways, + depending on the form of the annotation result of an adjacent "contains" keyword. The first way is if the annotation result is an array and the length of that array is greater than or equal to the "minContains" value. The second way is if the - annotation result is a boolean "true" and the instance array length is - greater than or equal to the "minContains" value. + annotation result is a boolean "true" and the instance length (number of + items or properties) is greater than or equal to the "minContains" value. A value of 0 is allowed, but is only useful for setting a range