|
746 | 746 | branch of an "allOf" MUST NOT have an impact on a "then"
|
747 | 747 | or "else" in another branch.
|
748 | 748 | </t>
|
| 749 | + <t> |
| 750 | + There is no default behavior for any of these keywords |
| 751 | + when they are not present. In particular, they MUST NOT |
| 752 | + be treated as if present with an empty schema, and when |
| 753 | + "if" is not present, both "then" and "else" MUST be |
| 754 | + entirely ignored. |
| 755 | + </t> |
749 | 756 | <section title="if">
|
750 | 757 | <t>
|
751 | 758 | This keyword's value MUST be a valid JSON Schema.
|
752 | 759 | </t>
|
| 760 | + <t> |
| 761 | + This validation outcome of this keyword's subschema |
| 762 | + has no direct effect on the overall validation |
| 763 | + result. Rather, it controls which of the "then" |
| 764 | + or "else" keywords are evaluated. |
| 765 | + </t> |
753 | 766 | <t>
|
754 | 767 | Instances that successfully validate against this
|
755 | 768 | keyword's subschema MUST also be valid against
|
|
763 | 776 | present.
|
764 | 777 | </t>
|
765 | 778 | <t>
|
766 |
| - Validation of the instance against this keyword |
767 |
| - on its own always succeeds, regardless of the |
768 |
| - validation outcome of the instance against its subschema. |
| 779 | + If <xref target="annotations">annotations</xref> |
| 780 | + are being collected, they are collected from this |
| 781 | + keyword's subschema in the usual way, including when |
| 782 | + the keyword is present without either "then" or "else". |
769 | 783 | </t>
|
770 | 784 | </section>
|
771 | 785 | <section title="then">
|
772 | 786 | <t>
|
773 | 787 | This keyword's value MUST be a valid JSON Schema.
|
774 | 788 | </t>
|
775 | 789 | <t>
|
776 |
| - When present alongside of "if", the instance |
777 |
| - successfully validates against this keyword if |
778 |
| - it validates against both the "if"'s subschema |
779 |
| - and this keyword's subschema. |
| 790 | + When "if" is present, and the instance successfully |
| 791 | + validates against its subschema, then valiation |
| 792 | + succeeds against this keyword if the instance also |
| 793 | + successfully validates against this keyword's subschema. |
780 | 794 | </t>
|
781 | 795 | <t>
|
782 |
| - When "if" is absent, or the instance fails to |
783 |
| - validate against its subschema, validation against |
784 |
| - this keyword always succeeds, regardless of the |
785 |
| - validation outcome of the instance against its subschema. |
786 |
| - Implementations SHOULD avoid attempting to validate against |
787 |
| - the subschema in these cases. |
| 796 | + This keyword has no effect when "if" is absent, or |
| 797 | + when the instance fails to validate against its |
| 798 | + subschema. Implementations MUST NOT evaluate |
| 799 | + the instance against this keyword, for either validation |
| 800 | + or annotation collection purposes, in such cases. |
788 | 801 | </t>
|
789 | 802 | </section>
|
790 | 803 | <section title="else">
|
791 | 804 | <t>
|
792 | 805 | This keyword's value MUST be a valid JSON Schema.
|
793 | 806 | </t>
|
794 | 807 | <t>
|
795 |
| - When present alongside of "if", the instance |
796 |
| - successfully validates against this keyword if |
797 |
| - it fails to validate against the "if"'s |
798 |
| - subschema, and successfully validates against |
799 |
| - this keyword's subschema. |
| 808 | + When "if" is present, and the instance fails to |
| 809 | + validate against its subschema, then valiation |
| 810 | + succeeds against this keyword if the instance |
| 811 | + successfully validates against this keyword's subschema. |
800 | 812 | </t>
|
801 | 813 | <t>
|
802 |
| - When "if" is absent, or the instance successfully |
803 |
| - validates against its subschema, validation against |
804 |
| - this keyword always succeeds, regardless of the |
805 |
| - validation outcome of the instance against its subschema. |
806 |
| - Implementations SHOULD avoid attempting to validate against |
807 |
| - the subschema in these cases. |
| 814 | + This keyword has no effect when "if" is absent, or |
| 815 | + when the instance successfully validates against its |
| 816 | + subschema. Implementations MUST NOT evaluate |
| 817 | + the instance against this keyword, for either validation |
| 818 | + or annotation collection purposes, in such cases. |
808 | 819 | </t>
|
809 | 820 | </section>
|
810 | 821 | </section>
|
|
0 commit comments