diff --git a/augur/validate.py b/augur/validate.py index 5c3defb47..966df6e48 100644 --- a/augur/validate.py +++ b/augur/validate.py @@ -9,6 +9,7 @@ import jsonschema.exceptions import re from itertools import groupby +from referencing import Registry from textwrap import indent from typing import Iterable, Union from augur.data import as_file @@ -48,8 +49,8 @@ def load_json_schema(path, refs=None): for k, v in refs.items(): with as_file(v) as file, open_file(file, "r") as fh: schema_store[k] = json.load(fh) - resolver = jsonschema.RefResolver.from_schema(schema,store=schema_store) - schema_validator = Validator(schema, resolver=resolver) + registry = Registry().with_contents(schema_store.items()) + schema_validator = Validator(schema, registry=registry) else: schema_validator = Validator(schema) diff --git a/setup.py b/setup.py index 81aad167d..9972ab3eb 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,8 @@ "cvxopt >=1.1.9, ==1.*", "importlib_resources >=5.3.0; python_version < '3.11'", "isodate ==0.6.*", - "jsonschema >=3.0.0, ==3.*", + "jsonschema >=4.18.0, ==4.*", + "referencing >=0.30.0", "networkx >= 2.5, <4", "numpy ==1.*", "packaging >=19.2",