Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Minimal updates for 2020-12
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesrosiers committed Aug 23, 2021
1 parent 1acbf8c commit 2b82239
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion source/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ not required.

.. schema_example::

{ "$schema": "https://json-schema.org/draft/2019-09/schema" }
{ "$schema": "https://json-schema.org/draft/2020-12/schema" }

.. draft_specific::

Expand Down
7 changes: 4 additions & 3 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
sys.path.insert(0, os.path.abspath(os.path.dirname('__file__')))

# The default JSON Schema dialect to test the examples against
jsonschema_standard = 'https://json-schema.org/draft/2019-09/schema'
jsonschema_standard = 'https://json-schema.org/draft/2020-12/schema'

rst_prolog = """
.. role:: new
.. |draft2020-12| replace:: :new:`New in draft 2020-12`
.. |draft2019-09| replace:: :new:`New in draft 2019-09`
.. |draft7| replace:: :new:`New in draft 7`
.. |draft6| replace:: :new:`New in draft 6`
Expand Down Expand Up @@ -64,9 +65,9 @@
# built documents.
#
# The short X.Y version.
version = '2019-09'
version = '2020-12'
# The full version, including alpha/beta/rc tags.
release = '2019-09'
release = '2020-12'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
10 changes: 5 additions & 5 deletions source/conventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ Draft-specific notes
--------------------

The JSON Schema standard has been through a number of revisions or
"drafts". The current version is Draft 2019-09, but some older drafts
"drafts". The current version is Draft 2020-12, but some older drafts
are still widely used as well.

The text is written to encourage the use of Draft 2019-09 and gives
The text is written to encourage the use of Draft 2020-12 and gives
priority to the latest conventions and features, but where it differs
from earlier drafts, those differences are highlighted in special
call-outs. If you only wish to target Draft 2019-09, you can safely
call-outs. If you only wish to target Draft 2020-12, you can safely
ignore those sections.

|draft2019-09|
|draft2020-12|

.. draft_specific::

--Draft 7
--Draft 2019-09
This is where anything pertaining to an old draft would be mentioned.


Expand Down
2 changes: 1 addition & 1 deletion source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ validator---just yet.

.. note::

This book describes JSON Schema draft 2019-09. Earlier versions of
This book describes JSON Schema draft 2020-12. Earlier versions of
JSON Schema are not completely compatible with the format
described here, but for the most part, those differences are noted
in the text.
Expand Down
3 changes: 2 additions & 1 deletion source/reference/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ The ``pattern`` keyword is used to restrict a string to a particular
regular expression. The regular expression syntax is the one defined
in JavaScript (`ECMA 262
<http://www.ecma-international.org/publications/standards/Ecma-262.htm>`__
specifically). See `regular-expressions` for more information.
specifically) with Unicode support. See `regular-expressions` for
more information.

.. note::
When defining the regular expressions, it's important to note that
Expand Down
2 changes: 1 addition & 1 deletion source/sphinxext/jsonschemaext.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def validate(schema, part, standard):

return (is_valid, message)
else:
catalogue = Catalogue('2019-09')
catalogue = Catalogue('2019-09', '2020-12')
Catalogue._default_catalogue = catalogue

compiled_schema = JSONSchema(schema.json, metaschema_uri=URI(standard))
Expand Down

0 comments on commit 2b82239

Please sign in to comment.