diff options
author | Julian Berman <Julian@GrayVines.com> | 2022-11-17 13:52:33 -0500 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2022-11-17 14:08:44 -0500 |
commit | 4f8f346cc475439715833ac6bd6e5c5e3dc21ee3 (patch) | |
tree | b50ad9d7536dda80b0311ff7680aaa9c0cc487da /jsonschema/validators.py | |
parent | 7830605c1c4993df864d292c8555fa3cf414f6ca (diff) | |
download | jsonschema-4f8f346cc475439715833ac6bd6e5c5e3dc21ee3.tar.gz |
Un-bundle single-vocabulary meta-schemas.
This seems to work (thanks @FFY00), even though
previously I thought I was having issues with
importlib.resources. Let's see if CI agrees.
Diffstat (limited to 'jsonschema/validators.py')
-rw-r--r-- | jsonschema/validators.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/jsonschema/validators.py b/jsonschema/validators.py index 2e33c40..6ceb75f 100644 --- a/jsonschema/validators.py +++ b/jsonschema/validators.py @@ -103,7 +103,11 @@ def _id_of(schema): def _store_schema_list(): if not _VOCABULARIES: - _VOCABULARIES.extend(_utils.load_schema("vocabularies").items()) + package = _utils.resources.files(__package__) + for version in package.joinpath("schemas", "vocabularies").iterdir(): + for path in version.iterdir(): + vocabulary = json.loads(path.read_text()) + _VOCABULARIES.append((vocabulary["$id"], vocabulary)) return [ (id, validator.META_SCHEMA) for id, validator in _META_SCHEMAS.items() ] + _VOCABULARIES |