diff --git a/CHANGELOG.md b/CHANGELOG.md index feaff803..a4b09854 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Infinite recursion in some cases. [#146](https://github.com/Stranger6667/jsonschema-rs/issues/146) +- `$ref` interaction with `$recursiveAnchor` in Draft 2019-09. ## [0.24.1] - 2024-10-21 diff --git a/crates/jsonschema-py/CHANGELOG.md b/crates/jsonschema-py/CHANGELOG.md index 3bf8e30d..0b4ed4a6 100644 --- a/crates/jsonschema-py/CHANGELOG.md +++ b/crates/jsonschema-py/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - Infinite recursion in some cases. [#146](https://github.com/Stranger6667/jsonschema-rs/issues/146) +- `$ref` interaction with `$recursiveAnchor` in Draft 2019-09. ## [0.24.1] - 2024-10-22 diff --git a/crates/jsonschema-py/tests-py/test_suite.py b/crates/jsonschema-py/tests-py/test_suite.py index 8bbc1b7d..095ba54e 100644 --- a/crates/jsonschema-py/tests-py/test_suite.py +++ b/crates/jsonschema-py/tests-py/test_suite.py @@ -55,7 +55,7 @@ def mock_server(): "4": ("bignum.json",), "6": ("bignum.json",), "7": ("bignum.json",), - "2019-09": ("bignum.json", "ref.json", "unevaluatedProperties.json"), + "2019-09": ("bignum.json", "unevaluatedProperties.json"), "2020-12": ("bignum.json", "unevaluatedProperties.json"), } diff --git a/crates/jsonschema/src/compiler.rs b/crates/jsonschema/src/compiler.rs index 495d09ff..e011ee71 100644 --- a/crates/jsonschema/src/compiler.rs +++ b/crates/jsonschema/src/compiler.rs @@ -207,11 +207,7 @@ impl<'a> Context<'a> { reference: &str, is_recursive: bool, ) -> Result, ValidationError<'static>> { - let resolved = if reference == "#" { - // Known & simple recursive reference - // It may also use some additional logic from the `$recursiveAnchor` keyword - self.resolver.lookup_recursive_ref()? - } else if self.is_circular_reference(reference)? { + let resolved = if self.is_circular_reference(reference)? { // Otherwise we need to manually check whether this location has already been explored self.resolver.lookup(reference)? } else { diff --git a/crates/jsonschema/tests/suite.rs b/crates/jsonschema/tests/suite.rs index ab77d7af..02375d54 100644 --- a/crates/jsonschema/tests/suite.rs +++ b/crates/jsonschema/tests/suite.rs @@ -16,7 +16,6 @@ mod tests { xfail = [ "draft4::optional::bignum::integer::a_bignum_is_an_integer", "draft4::optional::bignum::integer::a_negative_bignum_is_an_integer", - "draft2019-09::r#ref::ref_with_recursive_anchor::extra_items_allowed_for_inner_arrays", "draft2019-09::unevaluated_properties::unevaluated_properties_with_recursive_ref::with_no_unevaluated_properties_10", "draft2020-12::unevaluated_properties::unevaluated_properties_with_dynamic_ref::with_no_unevaluated_properties_21", ]