A schema must be a JSON object or a boolean: true always passes (like
{}) and false always fails (like
{ "not": {} }). This page follows JSON Schema 2020-12, whose keywords are
grouped into vocabularies:
JSON Schema Core
and JSON Schema
Validation (as served there, draft-bhutton-json-schema-01 and
draft-bhutton-json-schema-validation-01, 16 June 2022), read 2026-11-12. The drafts table
follows json-schema.org’s
specification links, the
release notes for draft
6, draft 7,
2019-09 and
2020-12, and the
published meta-schemas, read 2026-11-12.
Core
The Core vocabulary’s keywords all begin with $, and the Core
vocabulary is always required.
| Keyword | Meaning |
|---|---|
$schema | The dialect, as the URI of a meta-schema the schema must validate against; see drafts. |
$id | Identifies a schema resource with its canonical URI, which also becomes the base URI for relative references inside it. |
$ref | Applies the schema at a URI-reference resolved against the base URI, such as #/$defs/positiveInteger. Other keywords may sit beside it. |
$anchor | A plain-name fragment ("foo" becomes #foo): a letter or _, then letters, digits, -, _ or .. |
$dynamicRef, $dynamicAnchor | References resolved at evaluation time through the dynamic scope, for extending recursive schemas. |
$vocabulary | In meta-schemas: which vocabularies are available, each marked required (true) or optional (false). |
$comment | A comment from schema authors to readers or maintainers; never shown to end users. |
$defs | A place for reusable schemas; does not affect validation directly. |
Applicators
These keywords are in the Applicator vocabulary, except the two
unevaluated keywords, which 2020-12 moved into their own Unevaluated
vocabulary.
| Keyword | Applies to |
|---|---|
allOf, anyOf, oneOf, not | Combine schemas. |
if, then, else | Conditional schemas. |
dependentSchemas | Schemas applied to the whole object when a property is present. |
prefixItems, items | Array elements by position, then the rest. |
contains | At least one element must match, unless minContains is 0. |
properties, patternProperties, additionalProperties | Object members by name, by regular expression, and the rest. |
propertyNames | Every member name. |
unevaluatedItems, unevaluatedProperties (Unevaluated vocabulary) | Elements and members not successfully evaluated by adjacent keywords, including through sub-schemas and references. |
Validation
The Validation vocabulary’s keywords are all assertions.
| For | Keywords |
|---|---|
| Any value | type (null, boolean, object, array, number, string, or integer for any number with a zero fractional part; or an array of unique names), enum, const. |
| Numbers | multipleOf, maximum, exclusiveMaximum, minimum, exclusiveMinimum. |
| Strings | maxLength, minLength (counting characters as RFC 8259 defines them), pattern (ECMA-262 regular expression, not implicitly anchored). |
| Arrays | maxItems, minItems, uniqueItems, maxContains, minContains. |
| Objects | maxProperties, minProperties, required, dependentRequired. |
Formats
format has two vocabularies. Under Format-Annotation (the one the
default meta-schema requires) it is collected as an annotation; an implementation may
also check it, but only through an option that is off by default. Under
Format-Assertion it must be validated, and an implementation that cannot do so must
refuse the schema. Defined values: date-time, date, time,
duration, email, idn-email,
hostname, idn-hostname, ipv4,
ipv6, uri, uri-reference, iri,
iri-reference, uuid, uri-template,
json-pointer, relative-json-pointer,
regex.
Content and meta-data
Content vocabulary: contentEncoding (such as base64,
from RFC 4648 or RFC 2045), contentMediaType,
contentSchema. Meta-Data vocabulary: title,
description, default, deprecated,
readOnly, writeOnly, examples.
Drafts
| Draft | $schema | Main changes |
|---|---|---|
| Draft 4 (31 January 2013) | http://json-schema.org/draft-04/schema# | id without $; boolean exclusiveMaximum and exclusiveMinimum beside maximum and minimum; definitions. |
| Draft 5 (13 October 2016) | None of its own; keeps the draft 4 meta-schemas | A cleanup of draft 4 (draft-wright-json-schema-00); json-schema.org says not to implement or advertise “draft-05”. |
| Draft 6 (21 April 2017) | http://json-schema.org/draft-06/schema# | $id; numeric exclusive limits; const, contains, propertyNames, examples; boolean schemas allowed anywhere; 1.0 counts as an integer. |
| Draft 7 (19 March 2018) | http://json-schema.org/draft-07/schema# | if/then/else, $comment, writeOnly; readOnly, contentMediaType and contentEncoding moved in from Hyper-Schema. |
| 2019-09 (17 September 2019) | https://json-schema.org/draft/2019-09/schema | Vocabularies; definitions renamed $defs; $anchor; dependencies split into dependentSchemas and dependentRequired; unevaluatedItems, unevaluatedProperties; $recursiveRef, $recursiveAnchor; maxContains, minContains, contentSchema, deprecated. |
| 2020-12 (revised 16 June 2022) | https://json-schema.org/draft/2020-12/schema | prefixItems takes over array-form items, and items takes over additionalItems; $dynamicRef, $dynamicAnchor replace $recursiveRef, $recursiveAnchor; Unevaluated vocabulary split from Applicator; format split into Format-Annotation and Format-Assertion; items matched by contains count as evaluated. |
The OpenAPI 3.1.0 Schema Object is a superset of JSON Schema 2020-12; the OpenAPI 3.0.3 Schema Object is an extended subset of JSON Schema “Wright Draft 00”, which is draft 5. Both from the OpenAPI 3.1.0 and OpenAPI 3.0.3 specifications, read 2026-11-12.