From f4aa7c0327ea61aa11bef9e14a163404143dcc57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Wed, 7 Jun 2023 20:36:47 +0200 Subject: [PATCH] Bump the version of jsonschema (#1556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump the version of jsonschema OpenAPI 3.1 uses JSON Schema Draft 2020-12 so we need a version that supports it. Signed-off-by: Kévin Commaille * Add changelog Signed-off-by: Kévin Commaille * Fix PR number Signed-off-by: Kévin Commaille --------- Signed-off-by: Kévin Commaille --- changelogs/internal/newsfragments/1556.clarification | 1 + scripts/check-event-schema-examples.py | 2 +- scripts/requirements.txt | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 changelogs/internal/newsfragments/1556.clarification diff --git a/changelogs/internal/newsfragments/1556.clarification b/changelogs/internal/newsfragments/1556.clarification new file mode 100644 index 000000000..05c5897ec --- /dev/null +++ b/changelogs/internal/newsfragments/1556.clarification @@ -0,0 +1 @@ +Bump jsonschema to validate JSON Schemas against Draft 2020-12. diff --git a/scripts/check-event-schema-examples.py b/scripts/check-event-schema-examples.py index e5261c879..c61913216 100755 --- a/scripts/check-event-schema-examples.py +++ b/scripts/check-event-schema-examples.py @@ -88,7 +88,7 @@ def check_example_file(examplepath, schemapath): fileurl = "file://" + os.path.abspath(schemapath) schema["id"] = fileurl - resolver = jsonschema.RefResolver(schemapath, schema, handlers={"file": load_file}) + resolver = jsonschema.RefResolver(fileurl, schema, handlers={"file": load_file}) print ("Checking schema for: %r %r" % (examplepath, schemapath)) try: diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 9d9f11679..a3ff4f0b0 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -1,9 +1,8 @@ # no doubt older versions would be fine for many of these but these were # current at the time of writing -# jsonschema 3.0.0 objects to the $refs in our schema file. TODO: figure out -# why. -jsonschema >= 2.6.0, < 3.0.0 +# we need at least version 4.0.0 for support of JSON Schema Draft 2020-12. +jsonschema >= 4.0.0 PyYAML >= 3.12 requests >= 2.18.4