|
2085 | 2085 | "items", whose behavior is defined in terms of "prefixItems" |
2086 | 2086 | </t> |
2087 | 2087 | <t> |
2088 | | - "contains", whose behavior is defined in terms of "minContains" |
| 2088 | + "contains", whose behavior is affected by the presence and value of |
| 2089 | + "minContains", in the Validation vocabulary |
2089 | 2090 | </t> |
2090 | 2091 | </list> |
2091 | 2092 | </t> |
|
2339 | 2340 | </t> |
2340 | 2341 | <t> |
2341 | 2342 | An array instance is valid against "contains" if at least one of |
2342 | | - its elements is valid against the given schema. The subschema MUST be |
2343 | | - applied to every array element even after the first match has |
2344 | | - been found, in order to collect annotations for use by other keywords. |
2345 | | - This is to ensure that all possible annotations are collected. |
2346 | | - </t> |
2347 | | - <t> |
2348 | | - Logically, the validation result of applying the value subschema to each |
2349 | | - item in the array MUST be ORed with "false", resulting in an overall |
2350 | | - validation result. |
| 2343 | + its elements is valid against the given schema, |
| 2344 | + except when "minContains" is present and has a value of 0, in which |
| 2345 | + case an array instance MUST be valid against the "contains" keyword, |
| 2346 | + even if NONE of its elements is valid against the given schema. |
2351 | 2347 | </t> |
2352 | 2348 | <t> |
2353 | 2349 | This keyword produces an annotation value which is an array of |
|
2356 | 2352 | the subschema validates successfully when applied to every index of the |
2357 | 2353 | instance. The annotation MUST be present if the instance array to which |
2358 | 2354 | this keyword's schema applies is empty. |
| 2355 | + </t> |
| 2356 | + <t> |
2359 | 2357 | This annotation affects the behavior of "unevaluatedItems" in the |
2360 | | - Unevaluated vocabulary. |
| 2358 | + Unevaluated vocabulary, and MAY also be used to implement the |
| 2359 | + "minContains" and "maxContains" keywords in the Validation vocabulary. |
| 2360 | + </t> |
| 2361 | + <t> |
| 2362 | + The subschema MUST be applied to every array element even after the first |
| 2363 | + match has been found, in order to collect annotations for use by other |
| 2364 | + keywords. This is to ensure that all possible annotations are collected. |
2361 | 2365 | </t> |
2362 | 2366 | </section> |
2363 | 2367 | </section> |
|
0 commit comments