Supported JSON Schema versions
sphinx-jsonschema was initially written for JSON Schema Draft 4. It renders the keywords of the later drafts up to Draft 2020-12 as well.
The plugin does not need to know which draft a schema is written for.
The names of the keywords hardly overlap between the drafts, so every keyword is rendered when it is present and ignored otherwise.
Where two drafts use the same keyword differently, the value tells them apart.
A list in items is the tuple form of Draft 4 to 2019-09, a schema in items next to prefixItems is the form of Draft 2020-12.
The $schema keyword therefore does not influence the output.
The option show_schema displays it, see Directive.
Supported keywords
The tables list the draft that introduced each keyword. A keyword stays available in the later drafts unless the notes say it was replaced.
Core
Keyword |
Since |
Rendering |
|---|---|---|
|
Draft 4 |
Hidden; the option |
|
Draft 4, Draft 6 |
First row of the table; only the outermost value is shown.
|
|
Draft 7 |
Hidden; the option |
|
Draft 4 |
A link or plain text, see Directive.
Keywords next to |
|
Draft 4, Draft 2019-09 |
A list of the definitions, or separate sections with |
|
Draft 2019-09, 2020-12 |
A row of the schema it belongs to. The anchor is not a link target. |
|
Draft 2020-12, 2019-09 |
Rendered like |
|
Draft 2019-09 |
Not rendered, because it only occurs in meta-schemas. |
Types and values
Keyword |
Since |
Rendering |
|---|---|---|
|
Draft 4 |
Section heading and text; reStructuredText is allowed. |
|
Draft 4 |
A list of types is shown as |
|
Draft 4 |
A row each. |
|
Draft 6 |
A row. |
|
Draft 6 |
A row group. |
|
Draft 4 |
A row each. |
|
Draft 4, Draft 6 |
A row each. Boolean in Draft 4, a number from Draft 6 on. |
|
Draft 2019-09 |
A row. |
|
Draft 7 |
A row each. |
|
Draft 7 |
A row each. |
|
Draft 2019-09 |
A nested schema. |
Arrays
Keyword |
Since |
Rendering |
|---|---|---|
|
Draft 4 |
A schema, or a list of schemas for the tuple form (Draft 4 to 2019-09). |
|
Draft 4 |
A schema or a boolean.
Replaced by |
|
Draft 2020-12 |
Rendered like the list form of |
|
Draft 6 |
A nested schema. |
|
Draft 2019-09 |
A row each, below |
|
Draft 4 |
A row each. |
|
Draft 2019-09 |
A schema or a boolean. |
Objects
Keyword |
Since |
Rendering |
|---|---|---|
|
Draft 4 |
A list of the properties; required ones are shown in bold. |
|
Draft 4 |
A schema or a boolean. |
|
Draft 6 |
A nested schema. |
|
Draft 4 |
A row each. |
|
Draft 4 |
A list; the values are property names or schemas. Replaced in Draft 2019-09. |
|
Draft 2019-09 |
Rendered like |
|
Draft 2019-09 |
A schema or a boolean. |
Combining schemas
Keyword |
Since |
Rendering |
|---|---|---|
|
Draft 4 |
Nested schemas. |
|
Draft 7 |
Nested schemas; shown when at least two of the three have content. |
Boolean schemas |
Draft 6 |
|
Known limitations
Array keywords (
items,prefixItems,contains,unevaluatedItemsand so on) are only rendered for schemas withtype: array. A schema withouttypeis rendered as an object, so a subschema such as{"items": [...]}in anallOfneeds"type": "array".Anchors are shown, but
$ref: "#name"does not link to them.$vocabularyis ignored, so meta-schemas are only shown without their vocabularies.