|
783 | 783 | <t>
|
784 | 784 | A schema that itself describes a schema is called a meta-schema.
|
785 | 785 | Meta-schemas are used to validate JSON Schemas and specify which vocabulary
|
786 |
| - it is using. |
| 786 | + they are using. |
787 | 787 | </t>
|
788 | 788 | <t>
|
789 | 789 | Authors of extensions to JSON Schema are encouraged to write their own
|
|
812 | 812 | <t>
|
813 | 813 | The role of the meta-schema is to constrain the structure of conforming schemas,
|
814 | 814 | as well as simplify the process of composing multiple vocabularies into a usable
|
815 |
| - feature set. Schema authoring is obviously expected to be a common activity, so |
| 815 | + feature set. Schema authoring is expected to be a common activity, so |
816 | 816 | schema authors need only understand how to reference a single meta-schema.
|
817 | 817 | </t>
|
818 | 818 | <t>
|
|
873 | 873 | </t>
|
874 | 874 | <t>
|
875 | 875 | Values for this property are defined elsewhere in this and other documents,
|
876 |
| - and by other parties. JSON Schema implementations SHOULD implement support |
877 |
| - for current and previous published drafts of JSON Schema vocabularies |
878 |
| - as deemed reasonable. |
| 876 | + and by other parties. |
879 | 877 | </t>
|
880 | 878 | </section>
|
881 | 879 | <section title='The "$vocabulary" Keyword'>
|
882 | 880 | <t>
|
883 |
| - The "$vocabulary" keyword, like all keywords in meta-schemas, |
884 |
| - relates to the schema described by the meta-schema, rather than |
885 |
| - to the meta-schema itself. Specifically, "$vocabulary" declares |
| 881 | + The "$vocabulary" keyword, which appears in a meta-schema, declares |
886 | 882 | what sets of keywords are expected to be used in schemas described
|
887 |
| - by this meta-schema. |
| 883 | + by that meta-schema, and with what semantics. This is conceptually |
| 884 | + analogous to how most other keywords used in meta-schemas describe |
| 885 | + the syntax of keywords used in schemas described by that meta-schema. |
888 | 886 | </t>
|
889 | 887 | <t>
|
890 | 888 | The value of this keyword MUST be an object. The property names in the
|
|
933 | 931 | for use as a meta-schema. This is demonstrated in
|
934 | 932 | <xref target="example-meta-schema">the example meta-schema</xref>.
|
935 | 933 | </t>
|
| 934 | + <t> |
| 935 | + If "$vocabulary" is absent, an implementation MAY determine |
| 936 | + behavior based on the meta-schema if it is recognized from the |
| 937 | + URI value of the referring schema's "$schema" keyword. |
| 938 | + If the meta-schema, as referenced by the schema, is not recognized, |
| 939 | + then implementations MAY assume the use of all vocabularies in this |
| 940 | + specification and the companion Validation specification. |
| 941 | + </t> |
936 | 942 | </section>
|
937 | 943 | <section title="Detecting a Meta-Schema">
|
938 | 944 | <t>
|
|
986 | 992 | restricting usage to a subset of a vocabulary, and for validating
|
987 | 993 | locally defined keywords not intended for re-use.
|
988 | 994 | </t>
|
| 995 | + <t> |
| 996 | + However, meta-schemas SHOULD NOT contradict any vocabularies that |
| 997 | + they declare, such as by requiring a different JSON type than |
| 998 | + the vocabulary expects. The resulting behavior is undefined. |
| 999 | + </t> |
989 | 1000 | <t>
|
990 | 1001 | Meta-schemas intended for local use, with no need to test for
|
991 | 1002 | vocabulary support in arbitrary implementations, can safely omit
|
|
0 commit comments