1
0
Fork 0

Additional schema fixes (#17414)

This commit is contained in:
Joel Challis 2022-06-18 06:30:46 +01:00 committed by GitHub
parent 7b3ee1db8c
commit 17ec1650fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 64 deletions

View file

@ -68,11 +68,7 @@ def create_validator(schema):
schema_store = compile_schema_store()
resolver = jsonschema.RefResolver.from_schema(schema_store[schema], store=schema_store)
# 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
return jsonschema.Draft202012Validator(schema_store[schema], resolver=resolver).validate
def validate(data, schema):