Specification Versioning
This specification is identified collectively by two values:- Version: Denoted as the letter “v” followed by the version number
- Release Year: The year the specification was released
- “v1/2026” denotes version 1, released in 2026
- “v2/2042” would denote version 2, released in 2042
Compatibility Guarantees
A schema written to conform with the requirements of a given version is compatible with successive specifications that are published with:- The same version number
- The same or greater release year value
JSON Schema provides a guarantee of forward compatibility for future releases within a version.
- A schema conforming to v1/2026 will work with v1/2027, v1/2028, etc.
- A schema conforming to v1/2026 may NOT work with v2/2026
- Implementations supporting v1/2027 must also support schemas from v1/2026
The $schema Keyword
The $schema keyword serves dual purposes:
- Dialect identifier: Indicates which JSON Schema dialect the schema conforms to
- Meta-schema reference: Points to a resource that is itself a JSON Schema describing the set of valid schemas for this dialect
- An IRI (containing a scheme)
- Normalized according to IRI normalization rules
Usage
- Root Schema
- Embedded Resources
- Invalid Usage
The
$schema keyword SHOULD be used in the document root schema object:The identified dialect applies to the resource in which it is declared as well as any embedded schema resources, unless such a resource declares a different dialect with its own
$schema keyword.Dialect Determination
When evaluation encounters a new schema resource (i.e., the lexical scope changes), the first task is to determine the dialect. Implementations MUST determine the dialect using the following prioritized steps:The $schema keyword
If present, implementations MUST process the schema according to the dialect it declares.
Parent schema dialect
A schema resource embedded within another schema resource which does not contain a
$schema keyword MUST be processed using the same dialect as the schema which contains it.External context
In some contexts, there is a default dialect or a way to declare the dialect external from the schema resource:
- Embedded in non-schema documents: If the schema is embedded in a non-schema document (such as an OpenAPI Document), the semantics for determining the dialect MUST be determined by that document’s specification
- Media type: If the media type of the schema is known and defines a default dialect or way to declare a dialect, the dialect MUST be determined by the rules of that media type. For example, the
application/schema+jsonmedia type includes aschemaparameter for declaring the dialect
Meta-Schemas
Meta-schemas are used to inform an implementation how to interpret a schema. Every schema has a meta-schema, which can be explicitly declared using the$schema keyword.
The meta-schema serves to describe valid schema syntax. A schema resource MUST successfully validate against its meta-schema, which constrains the syntax of the available keywords.
Meta-schema authoring is an advanced usage of JSON Schema, so the design of meta-schema features emphasizes flexibility over simplicity.
Detecting a Meta-Schema
Implementations MUST recognize a schema as a meta-schema if it is being examined because it was identified as such by another schema’s$schema keyword.
This means a single schema document might sometimes be:
- A regular schema
- A meta-schema (when referenced by another schema’s
$schema)
- When processing begins, it is processed as a regular schema
- When loaded a second time as a result of checking its own
$schemavalue, it is treated as a meta-schema
Compound Documents and Dialects
When multiple schema resources are present in a single document:Default Dialect Inheritance
Schema resources which do not define with which dialect they should be processed MUST be processed with the same dialect as the enclosing resource:Different Dialects
Embedded schema resources MAY specify different processing dialects using$schema values from their enclosing resource:
Validating Compound Documents
Given that a Compound Schema Document may have embedded resources using different dialects: Instead:- Each Schema Resource SHOULD be separately validated against its associated meta-schema
- An alternate validation process should be provided to validate Schema Documents
$schema is omitted (and therefore defaults to that of the enclosing resource), MAY be validated by applying the appropriate meta-schema.
Future Development
Continued development of these specifications and support requirements for proposed features is managed in the json-schema-org/json-schema-spec GitHub repository and defined byPROCESS.md.
Draft Releases
This document obsoletes the previous “draft” releases for JSON Schema and provides the basis for a stable, standardized version. Implementations MAY continue to support “draft” releases to facilitate the transition, typically by inspecting the value of the$schema keyword:
Common $schema Values
Here are commonly used $schema values:
JSON Schema 2020-12
JSON Schema 2020-12
prefixItems, $dynamicRef, and $dynamicAnchor.JSON Schema 2019-09
JSON Schema 2019-09
$recursiveRef, $recursiveAnchor, unevaluatedProperties, and unevaluatedItems.JSON Schema Draft 07
JSON Schema Draft 07
if/then/else, readOnly, writeOnly, and content keywords.JSON Schema Draft 06
JSON Schema Draft 06
const, contains, and propertyNames.Best Practices
Always Specify $schema
Include
$schema in your root schema to make the intended dialect explicitUse Stable Versions
For production schemas, use stable specification versions rather than working drafts
Document Mixed Dialects
If using multiple dialects in a compound document, document why each dialect is used
Test Across Versions
When upgrading to a new version, test your schemas thoroughly for compatibility
Next Steps
Core Keywords
Explore the
$schema and other core keywordsSchema Structure
Learn about schema resources and composition