Skip to content

Commit 6dd62bb

Browse files
committed
Wrong precedence, missing parens, incorrect code, hooray.
Fix misbehaving non-ID detection in pointers when the keyword itself takes a subschema.
1 parent ee1a810 commit 6dd62bb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

referencing/jsonschema.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,12 @@ def maybe_in_subresource(
237237
subresource: Resource[Any],
238238
) -> _Resolver[Any]:
239239
_segments = iter(segments)
240+
# FIXME: This is a ton of redone work, each time we recheck from the
241+
# beginning of the pointer, so long ones will just keep doing
242+
# that over and over again...
240243
for segment in _segments:
241-
if (
242-
segment not in in_value
243-
and segment not in in_child
244-
or next(_segments, None) is None
244+
if segment not in in_value and (
245+
segment not in in_child or next(_segments, None) is None
245246
):
246247
return resolver
247248
return resolver.in_subresource(subresource)

0 commit comments

Comments
 (0)