|
733 | 733 | <xref target="schema-document">schema object</xref>.
|
734 | 734 | </t>
|
735 | 735 | </section>
|
736 |
| - <section title="Default Behaviors"> |
| 736 | + <section title="Default Behaviors" anchor="default-behaviors"> |
737 | 737 | <t>
|
738 | 738 | A missing keyword MUST NOT produce a false assertion result, MUST
|
739 | 739 | NOT produce annotation results, and MUST NOT cause any other schema
|
|
2122 | 2122 | </t>
|
2123 | 2123 | <t>
|
2124 | 2124 | "contains", whose behavior is affected by the presence and value of
|
2125 |
| - "minContains", in the Validation vocabulary |
| 2125 | + "minContains" |
2126 | 2126 | </t>
|
2127 | 2127 | </list>
|
2128 | 2128 | </t>
|
|
2502 | 2502 | </section>
|
2503 | 2503 |
|
2504 | 2504 | <section title="Other Keywords for Applying Subschemas">
|
| 2505 | + <section title="maxContains"> |
| 2506 | + <t> |
| 2507 | + The value of this keyword MUST be a non-negative integer. |
| 2508 | + </t> |
| 2509 | + <t> |
| 2510 | + This keyword modifies the behavior of "contains" within the same schema object, |
| 2511 | + as described below in the section for that keyword. |
| 2512 | + </t> |
| 2513 | + <t> |
| 2514 | + Validation MUST always succeed against this keyword. |
| 2515 | + The value of this keyword is used as its annotation result. |
| 2516 | + </t> |
| 2517 | + </section> |
| 2518 | + |
| 2519 | + <section title="minContains"> |
| 2520 | + <t> |
| 2521 | + The value of this keyword MUST be a non-negative integer. |
| 2522 | + </t> |
| 2523 | + <t> |
| 2524 | + This keyword modifies the behavior of "contains" within the same schema object, |
| 2525 | + as described below in the section for that keyword. |
| 2526 | + </t> |
| 2527 | + <t> |
| 2528 | + Validation MUST always succeed against this keyword. |
| 2529 | + The value of this keyword is used as its annotation result. |
| 2530 | + </t> |
| 2531 | + <t> Per section <xref target="default-behaviors" format="counter"></xref>, |
| 2532 | + omitted keywords MUST NOT produce annotation results. However, as described |
| 2533 | + in the section for "contains", the absence of this keyword's annotation |
| 2534 | + causes "contains" to assume a minimum value of 1. |
| 2535 | + </t> |
| 2536 | + </section> |
| 2537 | + |
2505 | 2538 | <section title="contains">
|
2506 | 2539 | <t>
|
2507 | 2540 | The value of this keyword MUST be a valid JSON Schema.
|
2508 | 2541 | </t>
|
2509 | 2542 | <t>
|
2510 |
| - An array instance is valid against "contains" if at least one of |
2511 |
| - its elements is valid against the given schema, |
2512 |
| - except when "minContains" is present and has a value of 0, in which |
2513 |
| - case an array instance MUST be considered valid against the "contains" keyword, |
2514 |
| - even if none of its elements is valid against the given schema. |
| 2543 | + This keyword applies its subschema to array elements or object property values. |
| 2544 | + </t> |
| 2545 | + <t> |
| 2546 | + An instance is valid against "contains" if the number of elements or property |
| 2547 | + values that are valid against its subschema is with the inclusive range of |
| 2548 | + the minimum and (if any) maximum number of occurrences. |
| 2549 | + </t> |
| 2550 | + <t> |
| 2551 | + The maximum number of occurrences is provided by the "maxContains" keyword |
| 2552 | + within the same schema object as "contains". If "maxContains" is absent, |
| 2553 | + the maximum number of occurrences MUST be unbounded. |
2515 | 2554 | </t>
|
2516 | 2555 | <t>
|
2517 |
| - An object instance is valid against "contains" if at least one of |
2518 |
| - its properties is valid against the given schema, |
2519 |
| - except when "minContains" is present and has a value of 0, in which |
2520 |
| - case an object instance MUST be considered valid against the "contains" keyword, |
2521 |
| - even if none of its property values is valid against the given schema. |
| 2556 | + The minimum number of occurrences is provided by the "minContains" keyword |
| 2557 | + within the same schema object as "contains". If "minContains" is absent, |
| 2558 | + the minimum number of occurrences MUST be 1. |
| 2559 | + </t> |
| 2560 | + <t> |
| 2561 | + Implementations MAY implement the dependency on "minContians" and |
| 2562 | + "maxContains" by inspecting their values rather than reading annotations |
| 2563 | + produced by those keywords. |
2522 | 2564 | </t>
|
2523 | 2565 | <t>
|
2524 | 2566 | This keyword produces an annotation value which is an array of the
|
|
2531 | 2573 | </t>
|
2532 | 2574 | <t>
|
2533 | 2575 | This annotation affects the behavior of "unevaluatedItems" in the
|
2534 |
| - Unevaluated vocabulary, and MAY also be used to implement the |
2535 |
| - "minContains" and "maxContains" keywords in the Validation vocabulary. |
| 2576 | + Unevaluated vocabulary. |
2536 | 2577 | </t>
|
2537 | 2578 | <t>
|
2538 |
| - The subschema MUST be applied to every array element even after the first |
2539 |
| - match has been found, in order to collect annotations for use by other |
2540 |
| - keywords. This is to ensure that all possible annotations are collected. |
| 2579 | + The subschema MUST be applied to every array element or object property |
| 2580 | + value even after the first match has been found, in order to collect |
| 2581 | + annotations for use by other keywords. This is to ensure that all possible |
| 2582 | + annotations are collected. |
2541 | 2583 | </t>
|
2542 | 2584 | </section>
|
2543 | 2585 | </section>
|
|
0 commit comments