Skip to content

Commit 38b4c60

Browse files
committed
Remove the added argument to jsonschema.validators.create. julian@Airm ●
We need a better public API for vocabularies, and this unfortunately won't cut it. For now this is dirty, but works to load all vocabularies (which are just concatenated together). The reason this is needed is because I don't see a PEP302-compliant way to load a whole directory using the importlib.resources APIs (which call directories 'packages') -- and doing so manually would break importing jsonschema via a zip file, which is something historically that users were doing.
1 parent 1790fcc commit 38b4c60

17 files changed

+9
-615
lines changed

jsonschema/_utils.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,6 @@ def load_schema(name):
5858
return json.loads(data.decode("utf-8"))
5959

6060

61-
def load_vocabulary(name):
62-
"""
63-
Load all schema files from ./schemas/``name`` and return them as a list.
64-
"""
65-
vocabulary = []
66-
base_path = os.path.dirname(sys.modules["jsonschema"].__file__)
67-
pathlist = Path(os.path.join(base_path, "schemas", name)).glob("*.json")
68-
for path in pathlist:
69-
with open(path) as data:
70-
vocabulary.append(json.load(data))
71-
return vocabulary
72-
73-
7461
def format_as_index(container, indices):
7562
"""
7663
Construct a single string containing indexing operations for the indices.

jsonschema/schemas/draft2019-09/applicator.json

Lines changed: 0 additions & 56 deletions
This file was deleted.

jsonschema/schemas/draft2019-09/content.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

jsonschema/schemas/draft2019-09/core.json

Lines changed: 0 additions & 57 deletions
This file was deleted.

jsonschema/schemas/draft2019-09/format.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

jsonschema/schemas/draft2019-09/hyper-schema.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

jsonschema/schemas/draft2019-09/meta-data.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

jsonschema/schemas/draft2019-09/validation.json

Lines changed: 0 additions & 98 deletions
This file was deleted.

jsonschema/schemas/draft2020-12/applicator.json

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)