@@ -884,7 +884,10 @@ meta-schema features emphasizes flexibility over simplicity.
884
884
885
885
The ` $schema ` keyword is both used as a JSON Schema dialect identifier and as
886
886
the identifier of a resource which is itself a JSON Schema, which describes the
887
- set of valid schemas written for this particular dialect.
887
+ set of valid schemas written for this particular dialect. The identified dialect
888
+ applies to the resource in which it is declared as well as any embedded schema
889
+ resources, unless such a resource itself declares a different dialect by
890
+ including the ` $schema ` keyword with a different value.
888
891
889
892
The value of this keyword MUST be an [ IRI] ( #rfc3987 ) (containing a scheme) and
890
893
this IRI MUST be normalized. The current schema MUST be valid against the
@@ -894,20 +897,21 @@ If this IRI identifies a retrievable resource, that resource SHOULD be of media
894
897
type ` application/schema+json ` .
895
898
896
899
The ` $schema ` keyword SHOULD be used in the document root schema object, and MAY
897
- be used in the root schema objects of embedded schema resources. It MUST NOT
898
- appear in non-resource root schema objects .
900
+ be used in the root schema objects of embedded schema resources. When the
901
+ keyword appears in non-resource root schema object, the behavior is undefined .
899
902
900
- If present in the document root schema, an implementation MUST process the
903
+ If present in the resource root schema, an implementation MUST process the
901
904
schema in accordance with the associated dialect.
902
905
903
- If absent from the document root schema, and an ` application/schema+json ` media
904
- type with a ` schema ` parameter is available, then the schema MUST be processed
905
- in accordance with the dialect indicated by the ` schema ` parameter.
906
+ If absent from the resource root schema, and no parent dialect is defined, the
907
+ schema MUST be processed with the following priorities:
906
908
907
- For cases where the ` $schema ` keyword is absent from the document root, no media
908
- type is provided, and/or the media type has no ` schema ` parameter, an
909
- implementation MAY offer a mechanism for the user to explicitly set the
910
- dialect.
909
+ 1 . If the implementation accepts media type parameter inputs, and an
910
+ ` application/schema+json ` media type with a ` schema ` parameter is available,
911
+ then the schema MUST be processed in accordance with the dialect indicated by
912
+ the ` schema ` parameter.
913
+ 2 . An implementation MAY offer a mechanism for the user to explicitly set the
914
+ dialect.
911
915
912
916
If the dialect is not specified through one of these methods, the implementation
913
917
MUST refuse to process the schema, as with unsupported required vocabularies.
0 commit comments