Skip to content

Commit c2934ed

Browse files
committed
More review feedback on "$vocabulary"
1 parent c4cd69d commit c2934ed

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
@@ -783,7 +783,7 @@
783783
<t>
784784
A schema that itself describes a schema is called a meta-schema.
785785
Meta-schemas are used to validate JSON Schemas and specify which vocabulary
786-
it is using.
786+
they are using.
787787
</t>
788788
<t>
789789
Authors of extensions to JSON Schema are encouraged to write their own
@@ -812,7 +812,7 @@
812812
<t>
813813
The role of the meta-schema is to constrain the structure of conforming schemas,
814814
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
816816
schema authors need only understand how to reference a single meta-schema.
817817
</t>
818818
<t>
@@ -873,18 +873,16 @@
873873
</t>
874874
<t>
875875
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.
879877
</t>
880878
</section>
881879
<section title='The "$vocabulary" Keyword'>
882880
<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
886882
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.
888886
</t>
889887
<t>
890888
The value of this keyword MUST be an object. The property names in the
@@ -933,6 +931,14 @@
933931
for use as a meta-schema. This is demonstrated in
934932
<xref target="example-meta-schema">the example meta-schema</xref>.
935933
</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>
936942
</section>
937943
<section title="Detecting a Meta-Schema">
938944
<t>
@@ -986,6 +992,11 @@
986992
restricting usage to a subset of a vocabulary, and for validating
987993
locally defined keywords not intended for re-use.
988994
</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>
9891000
<t>
9901001
Meta-schemas intended for local use, with no need to test for
9911002
vocabulary support in arbitrary implementations, can safely omit

0 commit comments

Comments
 (0)