Skip to content

Fix nested local reference resolution - #700

Open
Guflly wants to merge 1 commit into
python-jsonschema:mainfrom
Guflly:fix/nested-local-ref-resolution
Open

Fix nested local reference resolution#700
Guflly wants to merge 1 commit into
python-jsonschema:mainfrom
Guflly:fix/nested-local-ref-resolution

Conversation

@Guflly

@Guflly Guflly commented Aug 2, 2026

Copy link
Copy Markdown

Resolves nested local $ref paths from the file that declares them instead of the root schema. Adds an acceptance test with a nested schema directory.

Local checks: 606 tests passed, 20 skipped; mypy and pre-commit also pass.

Fixes #640

@Guflly
Guflly force-pushed the fix/nested-local-ref-resolution branch from 27d581e to 13251e5 Compare August 2, 2026 18:32
@sirosen

sirosen commented Aug 8, 2026

Copy link
Copy Markdown
Member

Hi, thanks for this! It looks more correct than the last fix someone sent, but I don't quite understand why it should work.

The current reference registry is built such that it's supposed to fallback to the retrieval URI if the $id is not present. I'm not clear on why it's not working in this case, but I'd rather that we fix it than start mutating the schema being evaluated.

Do you know why this is effective, when the lines here are meant to have a similar effect already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to resolve nested $refs when using local files

2 participants