summaryrefslogtreecommitdiff
path: root/jsonschema/_utils.py
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-09-29 18:59:03 -0400
committerJulian Berman <Julian@GrayVines.com>2021-09-29 18:59:03 -0400
commit38b4c603a0f232ddbf94f9129263a1d1ff45ddae (patch)
treedf551f89f44773a7c8c885a3905b6994350850cc /jsonschema/_utils.py
parent1790fcc12678ed2281e7bf2106c8de7d4cc0523f (diff)
downloadjsonschema-38b4c603a0f232ddbf94f9129263a1d1ff45ddae.tar.gz
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.
Diffstat (limited to 'jsonschema/_utils.py')
-rw-r--r--jsonschema/_utils.py13
1 files changed, 0 insertions, 13 deletions
diff --git a/jsonschema/_utils.py b/jsonschema/_utils.py
index 3125f1e..15e2089 100644
--- a/jsonschema/_utils.py
+++ b/jsonschema/_utils.py
@@ -58,19 +58,6 @@ def load_schema(name):
return json.loads(data.decode("utf-8"))
-def load_vocabulary(name):
- """
- Load all schema files from ./schemas/``name`` and return them as a list.
- """
- vocabulary = []
- base_path = os.path.dirname(sys.modules["jsonschema"].__file__)
- pathlist = Path(os.path.join(base_path, "schemas", name)).glob("*.json")
- for path in pathlist:
- with open(path) as data:
- vocabulary.append(json.load(data))
- return vocabulary
-
-
def format_as_index(container, indices):
"""
Construct a single string containing indexing operations for the indices.