Skip to content

Commit c9abdcb

Browse files
committed
More review feedback on "$vocabulary"
1 parent 36840f8 commit c9abdcb

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

jsonschema-core.xml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@
790790
<t>
791791
A schema that itself describes a schema is called a meta-schema.
792792
Meta-schemas are used to validate JSON Schemas and specify which vocabulary
793-
it is using.
793+
they are using.
794794
</t>
795795
<t>
796796
Authors of extensions to JSON Schema are encouraged to write their own
@@ -819,7 +819,7 @@
819819
<t>
820820
The role of the meta-schema is to constrain the structure of conforming schemas,
821821
as well as simplify the process of composing multiple vocabularies into a usable
822-
feature set. Schema authoring is obviously expected to be a common activity, so
822+
feature set. Schema authoring is expected to be a common activity, so
823823
schema authors need only understand how to reference a single meta-schema.
824824
</t>
825825
<t>
@@ -880,18 +880,16 @@
880880
</t>
881881
<t>
882882
Values for this property are defined elsewhere in this and other documents,
883-
and by other parties. JSON Schema implementations SHOULD implement support
884-
for current and previous published drafts of JSON Schema vocabularies
885-
as deemed reasonable.
883+
and by other parties.
886884
</t>
887885
</section>
888886
<section title='The "$vocabulary" Keyword'>
889887
<t>
890-
The "$vocabulary" keyword, like all keywords in meta-schemas,
891-
relates to the schema described by the meta-schema, rather than
892-
to the meta-schema itself. Specifically, "$vocabulary" declares
888+
The "$vocabulary" keyword, which appears in a meta-schema, declares
893889
what sets of keywords are expected to be used in schemas described
894-
by this meta-schema.
890+
by that meta-schema, and with what semantics. This is conceptually
891+
analogous to how most other keywords used in meta-schemas describe
892+
the syntax of keywords used in schemas described by that meta-schema.
895893
</t>
896894
<t>
897895
The value of this keyword MUST be an object. The property names in the
@@ -940,6 +938,14 @@
940938
for use as a meta-schema. This is demonstrated in
941939
<xref target="example-meta-schema">the example meta-schema</xref>.
942940
</t>
941+
<t>
942+
If "$vocabulary" is absent, an implementation MAY determine
943+
behavior based on the meta-schema if it is recognized from the
944+
URI value of the referring schema's "$schema" keyword.
945+
If the meta-schema, as referenced by the schema, is not recognized,
946+
then implementations MAY assume the use of all vocabularies in this
947+
specification and the companion Validation specification.
948+
</t>
943949
</section>
944950
<section title="Detecting a Meta-Schema">
945951
<t>
@@ -993,6 +999,11 @@
993999
restricting usage to a subset of a vocabulary, and for validating
9941000
locally defined keywords not intended for re-use.
9951001
</t>
1002+
<t>
1003+
However, meta-schemas SHOULD NOT contradict any vocabularies that
1004+
they declare, such as by requiring a different JSON type than
1005+
the vocabulary expects. The resulting behavior is undefined.
1006+
</t>
9961007
<t>
9971008
Meta-schemas intended for local use, with no need to test for
9981009
vocabulary support in arbitrary implementations, can safely omit

0 commit comments

Comments
 (0)