Skip to content

Commit 044298c

Browse files
committed
require $schema in schemas
1 parent 7ad5074 commit 044298c

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

jsonschema-core.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ The `$schema` keyword is both used as a JSON Schema dialect identifier and as
886886
the identifier of a resource which is itself a JSON Schema, which describes the
887887
set of valid schemas written for this particular dialect.
888888

889-
The value of this keyword MUST be a [IRI](#rfc3987) (containing a scheme) and
889+
The value of this keyword MUST be an [IRI](#rfc3987) (containing a scheme) and
890890
this IRI MUST be normalized. The current schema MUST be valid against the
891891
meta-schema identified by this IRI.
892892

@@ -895,14 +895,22 @@ type `application/schema+json`.
895895

896896
The `$schema` keyword SHOULD be used in the document root schema object, and MAY
897897
be used in the root schema objects of embedded schema resources. It MUST NOT
898-
appear in non-resource root schema objects. If absent from the document root
899-
schema, the resulting behavior is implementation-defined, but MUST fall within
900-
the following options:
901-
902-
- Refuse to process the schema, as with unsupported required vocabularies
903-
- Assume a specific, documented meta-schema
904-
- Document the process by which it examines the schema and determines which of a
905-
specific set of meta-schemas to assume
898+
appear in non-resource root schema objects.
899+
900+
If present in the document root schema, an implementation MUST process the
901+
schema in accordance with the associated dialect.
902+
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+
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.
911+
912+
If the dialect is not specified through one of these methods, the implementation
913+
MUST refuse to process the schema, as with unsupported required vocabularies.
906914

907915
Values for this property are defined elsewhere in this and other documents, and
908916
by other parties.

0 commit comments

Comments
 (0)