A JSON schema is written in JSON syntax and will be saved typically in a file with a .json extension. It is indicated as a JSON schema by the $schema keyword, which should be the first keyword of the top-level object and have a value that is the URI of the JSON schema version you want to use. Here are two examples showing how to use the $schema keyword:
{
"$schema": "http://json-schema.org/draft-07/schema#",
...
}
{
"$schema": "http://json-schema.org/schema#",
...
}
In the first example above, the schema version is explicitly named. Instead of explicitly selecting a version, you can use "http://json-schema.org/schema#", as in the second example above. This indicates that the schema version to be used is the latest version (currently 2020-12 and 2019-09-hyper).
In JSON Schema View, you can change the version in the combo box in the bar at the top of the main window (see screenshot below).
If you use a feature of a newer schema version and then switch to an older version that does not support this feature, then the following happens:
•A message appears asking whether you wish to remove/convert the feature or keep the feature
•If kept, the new feature's corresponding component or detail is shown in an orange text color. For example, if a value has been set for the const keyword (new in draft-06) and you switch the schema version to draft-04, then the value of the const keyword is displayed in orange.
For information about the JSON Schema specifications, especially about additional features with each version, see the links below:
JSON Schema specification: http://json-schema.org/specification.html
Draft-06 release notes: http://json-schema.org/draft-06/json-schema-release-notes.html
Draft-07 release notes: http://json-schema.org/draft-07/json-schema-release-notes.html
Draft 2019-09 (formerly Draft-08): http://json-schema.org/specification-links.html#2019-09-formerly-known-as-draft-8
Draft 2020-12: http://json-schema.org/specification-links.html#2020-12
Additionally, the following Hyper Schemas are available: draft-04-hyper, draft-06-hyper, draft-07-hyper, 2019-09-hyper.
Links to the core schemas and hyper schemas are available here: http://json-schema.org/specification-links.html.