Additional schema fixes (#17414)
This commit is contained in:
parent
7b3ee1db8c
commit
17ec1650fd
5 changed files with 45 additions and 64 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue