Skip to content

Replace $ref & $dynamicRef support / RefResolver with the new referencing library #1049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Mar 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0ce3cef
Drop support for 3.7.
Julian Dec 28, 2022
bf94d57
Move to retrieving schemas from the jsonschema-specifications registry.
Julian Dec 28, 2022
238e711
Deprecate jsonschema.RefResolver from both places it is importable.
Julian Dec 29, 2022
f6aa053
Load the test suite into a referencing.Registry for running tests.
Julian Feb 9, 2023
2c8f643
Minor regrouping of some to-be-modified/deprecated RefResolver tests.
Julian Feb 9, 2023
52340d7
Offload a small initial bit of id-related code to referencing.
Julian Feb 14, 2023
4ec24ab
Inline a function that will be RefResolver specific.
Julian Feb 15, 2023
9da55df
Move reference resolution to a (private) Validator method.
Julian Feb 15, 2023
635dc13
Deprecate Validator.resolver.
Julian Feb 15, 2023
69f3899
Actually depend on referencing and update docs requirements.
Julian Feb 16, 2023
2889feb
Make an evolve test not refer to reference resolution.
Julian Feb 16, 2023
a39e5c9
Move Validator._resolver to _ref_resolver.
Julian Feb 16, 2023
e826629
Resolve $ref using the referencing library.
Julian Feb 16, 2023
a93e88b
Claim full support now that we pass all referencing tests.
Julian Feb 16, 2023
bdda723
Flail to get Sphinx to find references again.
Julian Feb 16, 2023
a42bbd9
Fix the benchmark to pass the right type for remotes again.
Julian Feb 16, 2023
bd6a7d0
Update docs requirements.
Julian Feb 19, 2023
33e2882
Pin to newer pyrsistent.
Julian Feb 21, 2023
fcea5ad
Tighten up a type in the tests.
Julian Feb 21, 2023
34d19dc
Add some prose documentation on the new referencing API.
Julian Feb 22, 2023
8c4cd7c
These pass now actually.
Julian Feb 22, 2023
e922e79
Style
Julian Feb 22, 2023
25f40e5
Again bump the referencing version.
Julian Feb 23, 2023
787dbc9
Re-add the direct test of RefResolver's deprecation.
Julian Feb 23, 2023
3801d9a
Improve error messages for deprecation tests when they fail.
Julian Feb 23, 2023
19bdf61
Three more exception-related deprecations.
Julian Feb 23, 2023
84199e9
Elaborate a bit more in the referencing doc
Julian Feb 27, 2023
eb00447
Replace the other usages of pyrsistent with rpds.
Julian Mar 5, 2023
2b547c7
Avoid whatever nonsense pkg_resources error.
Julian Mar 6, 2023
94c60e4
Speed up Validator.evolve by pre-computing fields.
Julian Mar 6, 2023
1854b26
Bump requirements.
Julian Mar 8, 2023
4d6bff9
Link to the new referencing doc page.
Julian Mar 9, 2023
fcbeced
Another version bump.
Julian Mar 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Inline a function that will be RefResolver specific.
  • Loading branch information
Julian committed Feb 21, 2023
commit 4ec24ab4627adac1bdfb65028642b56ebf7c4c26
15 changes: 6 additions & 9 deletions jsonschema/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,6 @@ def _validates(cls):
return _validates


def _store_schema_list():
return [
(uri, each.contents) for uri, each in SPECIFICATIONS.items()
] + [
(id, validator.META_SCHEMA) for id, validator in _META_SCHEMAS.items()
]


def create(
meta_schema,
validators=(),
Expand Down Expand Up @@ -761,7 +753,12 @@ def __init__(

self._scopes_stack = [base_uri]

self.store = _utils.URIDict(_store_schema_list())
self.store = _utils.URIDict(
(uri, each.contents) for uri, each in SPECIFICATIONS.items()
)
self.store.update(
(id, each.META_SCHEMA) for id, each in _META_SCHEMAS.items()
)
self.store.update(store)
self.store.update(
(schema["$id"], schema)
Expand Down