From 2b82239e0d807241d7b635f4eeed21c24463a300 Mon Sep 17 00:00:00 2001 From: Jason Desrosiers Date: Thu, 15 Jul 2021 15:47:17 -0700 Subject: [PATCH] Minimal updates for 2020-12 --- source/basics.rst | 2 +- source/conf.py | 7 ++++--- source/conventions.rst | 10 +++++----- source/index.rst | 2 +- source/reference/string.rst | 3 ++- source/sphinxext/jsonschemaext.py | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/source/basics.rst b/source/basics.rst index 43eec95b..6a536be5 100644 --- a/source/basics.rst +++ b/source/basics.rst @@ -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:: diff --git a/source/conf.py b/source/conf.py index 5ac3b5bf..1d614e38 100644 --- a/source/conf.py +++ b/source/conf.py @@ -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` @@ -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. diff --git a/source/conventions.rst b/source/conventions.rst index a7efcfdd..3f560ea2 100644 --- a/source/conventions.rst +++ b/source/conventions.rst @@ -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. diff --git a/source/index.rst b/source/index.rst index b32f1fb8..5ffe1f45 100644 --- a/source/index.rst +++ b/source/index.rst @@ -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. diff --git a/source/reference/string.rst b/source/reference/string.rst index 12c1c8c5..e1c41e28 100644 --- a/source/reference/string.rst +++ b/source/reference/string.rst @@ -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 `__ -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 diff --git a/source/sphinxext/jsonschemaext.py b/source/sphinxext/jsonschemaext.py index 34f9c0d6..1c5f400f 100644 --- a/source/sphinxext/jsonschemaext.py +++ b/source/sphinxext/jsonschemaext.py @@ -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))