summaryrefslogtreecommitdiff
path: root/lib/python/qmk/json_schema.py
diff options
context:
space:
mode:
authorDrashna Jael're <drashna@live.com>2022-05-29 15:38:33 -0700
committerDrashna Jael're <drashna@live.com>2022-05-29 15:38:33 -0700
commit30aac80d5a6d8c6f7c06efb49189d748e70edc4a (patch)
treeceb11968ae41228e4b110c07467cdca7cc9cff22 /lib/python/qmk/json_schema.py
parent67f4e5f34489abf986dedb4984b256692086c615 (diff)
parente22a183329fd05d39f88bb9dfebe98cfa7cd8402 (diff)
Merge remote-tracking branch 'qmk 0.17.0' into firmware21
Diffstat (limited to 'lib/python/qmk/json_schema.py')
-rw-r--r--lib/python/qmk/json_schema.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/python/qmk/json_schema.py b/lib/python/qmk/json_schema.py
index 2b48782fbb..682346113e 100644
--- a/lib/python/qmk/json_schema.py
+++ b/lib/python/qmk/json_schema.py
@@ -68,7 +68,11 @@ def create_validator(schema):
schema_store = compile_schema_store()
resolver = jsonschema.RefResolver.from_schema(schema_store[schema], store=schema_store)
- return jsonschema.Draft7Validator(schema_store[schema], resolver=resolver).validate
+ # TODO: Remove this after the jsonschema>=4 requirement had time to reach users
+ try:
+ return jsonschema.Draft202012Validator(schema_store[schema], resolver=resolver).validate
+ except AttributeError:
+ return jsonschema.Draft7Validator(schema_store[schema], resolver=resolver).validate
def validate(data, schema):