From ce683a77c3ca645b230ba9fe884890012880b889 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 21 Mar 2022 10:32:49 +0000 Subject: [PATCH 1/5] FIX: Use correct URI for 2019 JSON metaschema --- docs/source/examples.rst | 8 ++++---- docs/source/quick_start_create_your_first_twine.rst | 6 +++--- tests/base.py | 4 ++-- tests/data/apps/empty_app/twine.json | 4 ++-- tests/data/apps/example_app/twine.json | 4 ++-- tests/data/apps/simple_app/twine.json | 2 +- tests/test_schema_strands.py | 2 +- tests/test_twine.py | 2 +- twined/schema/twine_schema.json | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 108da7a..2418b86 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -48,7 +48,7 @@ copied straight from the unit test cases, so you can always check there to see h "children": [ ], "configuration_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Foundation cost twin configuration", "description": "Set config parameters and constants at startup of the twin.", "type": "object", @@ -68,7 +68,7 @@ copied straight from the unit test cases, so you can always check there to see h } }, "input_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Input Values schema for the foundation cost twin", "description": "These values are supplied to the twin asynchronously over a web socket. So as these values change, the twin can reply with an update.", "type": "object", @@ -135,7 +135,7 @@ copied straight from the unit test cases, so you can always check there to see h ] }, "input_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Input Values for the weather service twin", "description": "This is a simple example for getting metocean conditions at a single location", "type": "object", @@ -174,7 +174,7 @@ copied straight from the unit test cases, so you can always check there to see h ] }, "output_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Output Values for the metocean service twin", "description": "The output values strand of an example twine", "type": "object", diff --git a/docs/source/quick_start_create_your_first_twine.rst b/docs/source/quick_start_create_your_first_twine.rst index 8fd4885..5b4e71f 100644 --- a/docs/source/quick_start_create_your_first_twine.rst +++ b/docs/source/quick_start_create_your_first_twine.rst @@ -24,7 +24,7 @@ Now, let's define an input values strand, to specify what values are required by "title": "My first digital twin", "description": "A simple example to build on..." "input_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Input Values schema for my first digital twin", "description": "These values are supplied to the twin by another program (often over a websocket, depending on your integration provider). So as these values change, the twin can reply with an update.", "type": "object", @@ -50,7 +50,7 @@ Finally, let's define an output values strand, to define what kind of data is re .. code-block:: javascript "output_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Output Values schema for my first digital twin", "description": "The twin will output data that matches this schema", "type": "object", @@ -108,4 +108,4 @@ Then parse and validate directly from the file: .. ATTENTION:: - LIBRARY IS UNDER CONSTRUCTION! WATCH THIS SPACE FOR MORE! \ No newline at end of file + LIBRARY IS UNDER CONSTRUCTION! WATCH THIS SPACE FOR MORE! diff --git a/tests/base.py b/tests/base.py index 48a229f..2701ba7 100644 --- a/tests/base.py +++ b/tests/base.py @@ -6,7 +6,7 @@ VALID_SCHEMA_TWINE = """ { "configuration_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", @@ -21,7 +21,7 @@ } }, "input_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Input Values", "description": "The input values strand of an example twine, with a required height value", "type": "object", diff --git a/tests/data/apps/empty_app/twine.json b/tests/data/apps/empty_app/twine.json index ad44e51..8acb62f 100644 --- a/tests/data/apps/empty_app/twine.json +++ b/tests/data/apps/empty_app/twine.json @@ -2,7 +2,7 @@ "children": [ ], "configuration_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", @@ -15,7 +15,7 @@ "datasets": {} }, "input_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Input Values", "description": "The input values strand of an example twine", "type": "object", diff --git a/tests/data/apps/example_app/twine.json b/tests/data/apps/example_app/twine.json index 1f93e78..31a989f 100644 --- a/tests/data/apps/example_app/twine.json +++ b/tests/data/apps/example_app/twine.json @@ -7,7 +7,7 @@ } ], "configuration_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", @@ -42,7 +42,7 @@ } }, "input_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Input Values", "description": "The input values strand of an example twine", "type": "object", diff --git a/tests/data/apps/simple_app/twine.json b/tests/data/apps/simple_app/twine.json index c3ceffa..4da1bff 100644 --- a/tests/data/apps/simple_app/twine.json +++ b/tests/data/apps/simple_app/twine.json @@ -1,6 +1,6 @@ { "configuration_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "Configuration for a simple app", "description": "The app creates a mandelbrot plot", "type": "object", diff --git a/tests/test_schema_strands.py b/tests/test_schema_strands.py index d9da440..82ec30d 100644 --- a/tests/test_schema_strands.py +++ b/tests/test_schema_strands.py @@ -50,7 +50,7 @@ def test_strand_not_found(self): valid_no_output_schema_twine = """ { "configuration_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", diff --git a/tests/test_twine.py b/tests/test_twine.py index d638a0d..2317eac 100644 --- a/tests/test_twine.py +++ b/tests/test_twine.py @@ -49,7 +49,7 @@ def test_broken_json_twine(self): { "children": [ "configuration_values_schema": { - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", diff --git a/twined/schema/twine_schema.json b/twined/schema/twine_schema.json index 06877a9..dade0dc 100644 --- a/twined/schema/twine_schema.json +++ b/twined/schema/twine_schema.json @@ -62,7 +62,7 @@ } }, "type": "object", - "$schema": "http://json-schema.org/2019-09/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "properties": { "children": { "type": "array", From b29d57983549f0411bfe6fabe732b7d97a5551a9 Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 21 Mar 2022 10:33:54 +0000 Subject: [PATCH 2/5] ENH: Use latest JSON metaschema --- docs/source/examples.rst | 8 ++++---- docs/source/quick_start_create_your_first_twine.rst | 4 ++-- tests/base.py | 4 ++-- tests/data/apps/empty_app/twine.json | 4 ++-- tests/data/apps/example_app/twine.json | 4 ++-- tests/data/apps/simple_app/twine.json | 2 +- tests/test_schema_strands.py | 2 +- tests/test_twine.py | 2 +- twined/schema/twine_schema.json | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/source/examples.rst b/docs/source/examples.rst index 2418b86..a44f680 100644 --- a/docs/source/examples.rst +++ b/docs/source/examples.rst @@ -48,7 +48,7 @@ copied straight from the unit test cases, so you can always check there to see h "children": [ ], "configuration_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Foundation cost twin configuration", "description": "Set config parameters and constants at startup of the twin.", "type": "object", @@ -68,7 +68,7 @@ copied straight from the unit test cases, so you can always check there to see h } }, "input_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Input Values schema for the foundation cost twin", "description": "These values are supplied to the twin asynchronously over a web socket. So as these values change, the twin can reply with an update.", "type": "object", @@ -135,7 +135,7 @@ copied straight from the unit test cases, so you can always check there to see h ] }, "input_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Input Values for the weather service twin", "description": "This is a simple example for getting metocean conditions at a single location", "type": "object", @@ -174,7 +174,7 @@ copied straight from the unit test cases, so you can always check there to see h ] }, "output_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Output Values for the metocean service twin", "description": "The output values strand of an example twine", "type": "object", diff --git a/docs/source/quick_start_create_your_first_twine.rst b/docs/source/quick_start_create_your_first_twine.rst index 5b4e71f..8359fb4 100644 --- a/docs/source/quick_start_create_your_first_twine.rst +++ b/docs/source/quick_start_create_your_first_twine.rst @@ -24,7 +24,7 @@ Now, let's define an input values strand, to specify what values are required by "title": "My first digital twin", "description": "A simple example to build on..." "input_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Input Values schema for my first digital twin", "description": "These values are supplied to the twin by another program (often over a websocket, depending on your integration provider). So as these values change, the twin can reply with an update.", "type": "object", @@ -50,7 +50,7 @@ Finally, let's define an output values strand, to define what kind of data is re .. code-block:: javascript "output_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Output Values schema for my first digital twin", "description": "The twin will output data that matches this schema", "type": "object", diff --git a/tests/base.py b/tests/base.py index 2701ba7..0fe7700 100644 --- a/tests/base.py +++ b/tests/base.py @@ -6,7 +6,7 @@ VALID_SCHEMA_TWINE = """ { "configuration_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", @@ -21,7 +21,7 @@ } }, "input_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Input Values", "description": "The input values strand of an example twine, with a required height value", "type": "object", diff --git a/tests/data/apps/empty_app/twine.json b/tests/data/apps/empty_app/twine.json index 8acb62f..9d7587f 100644 --- a/tests/data/apps/empty_app/twine.json +++ b/tests/data/apps/empty_app/twine.json @@ -2,7 +2,7 @@ "children": [ ], "configuration_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", @@ -15,7 +15,7 @@ "datasets": {} }, "input_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Input Values", "description": "The input values strand of an example twine", "type": "object", diff --git a/tests/data/apps/example_app/twine.json b/tests/data/apps/example_app/twine.json index 31a989f..01d0d02 100644 --- a/tests/data/apps/example_app/twine.json +++ b/tests/data/apps/example_app/twine.json @@ -7,7 +7,7 @@ } ], "configuration_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", @@ -42,7 +42,7 @@ } }, "input_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Input Values", "description": "The input values strand of an example twine", "type": "object", diff --git a/tests/data/apps/simple_app/twine.json b/tests/data/apps/simple_app/twine.json index 4da1bff..4409473 100644 --- a/tests/data/apps/simple_app/twine.json +++ b/tests/data/apps/simple_app/twine.json @@ -1,6 +1,6 @@ { "configuration_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Configuration for a simple app", "description": "The app creates a mandelbrot plot", "type": "object", diff --git a/tests/test_schema_strands.py b/tests/test_schema_strands.py index 82ec30d..17aa9b6 100644 --- a/tests/test_schema_strands.py +++ b/tests/test_schema_strands.py @@ -50,7 +50,7 @@ def test_strand_not_found(self): valid_no_output_schema_twine = """ { "configuration_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", diff --git a/tests/test_twine.py b/tests/test_twine.py index 2317eac..eda8192 100644 --- a/tests/test_twine.py +++ b/tests/test_twine.py @@ -49,7 +49,7 @@ def test_broken_json_twine(self): { "children": [ "configuration_values_schema": { - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "The example configuration form", "description": "The configuration strand of an example twine", "type": "object", diff --git a/twined/schema/twine_schema.json b/twined/schema/twine_schema.json index dade0dc..e63d8f6 100644 --- a/twined/schema/twine_schema.json +++ b/twined/schema/twine_schema.json @@ -62,7 +62,7 @@ } }, "type": "object", - "$schema": "https://json-schema.org/draft/2019-09/schema", + "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "children": { "type": "array", From 1b1bbaee6a32c95b9aceeb12d194db13266db3dd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 21 Mar 2022 10:36:02 +0000 Subject: [PATCH 3/5] OPS: Increase version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0b3f599..168097c 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( name="twined", - version="0.2.1", + version="0.2.2", py_modules=[], install_requires=["jsonschema ~= 3.2.0", "python-dotenv"], url="https://www.github.com/octue/twined", From 6d34f99fb794d3780ae3d4b84296609b93ba8def Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 21 Mar 2022 10:40:54 +0000 Subject: [PATCH 4/5] DEP: Use latest jsonschema package --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 168097c..c6e3c93 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ name="twined", version="0.2.2", py_modules=[], - install_requires=["jsonschema ~= 3.2.0", "python-dotenv"], + install_requires=["jsonschema ~= 4.4.0", "python-dotenv"], url="https://www.github.com/octue/twined", license="MIT", author="Octue (github: octue)", From 6c3835ca59cf74699dd2f7ad9e885a2141d6bbdd Mon Sep 17 00:00:00 2001 From: cortadocodes Date: Mon, 21 Mar 2022 11:34:45 +0000 Subject: [PATCH 5/5] FIX: Fix labels field of manifest schema --- twined/schema/manifest_schema.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/twined/schema/manifest_schema.json b/twined/schema/manifest_schema.json index 4bf3df2..cb8e311 100644 --- a/twined/schema/manifest_schema.json +++ b/twined/schema/manifest_schema.json @@ -7,11 +7,9 @@ "labels": { "description": "Textual labels associated with the object", "type": "array", - "items": [ - { - "type": "string" - } - ] + "items": { + "type": "string" + } } }, "type": "object",