$dynamicRef doesn't find $dynamicAnchor overrides in root schemas without $id

Open
#366 0 comments 0 reactions 0 assignees View on GitHub

@aqeelat is already working on this.

Since Jun 12, 2026.

  • #367 by @aqeelat — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
python
Domain
backend

Research direction

Start with the minimal reproducer referenced in python-jsonschema/jsonschema#1497 and trace the $dynamicRef and $dynamicAnchor resolution entry points in referencing. Confirm that a root schema without an $id honors overrides in its $defs, then add coverage showing that the override is selected instead of the template anchor.

Written by the indexing model from the issue text.

Description

$dynamicRef doesn't find $dynamicAnchor overrides in root schemas without $id

When a root schema has no $id and uses $ref to pull in a template containing $dynamicRef, the $dynamicRef ignores any $dynamicAnchor overrides defined in the root schema's $defs. It falls back to the template's own $dynamicAnchor instead.

Filed from python-jsonschema/jsonschema#1497. The root cause is in referencing — see that issue for the minimal reproducer.

Dominant language
Python
Stars
56
Forks
55
Avg merge
5d 22h
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-jsonschema/referencing

All issues in python-jsonschema/referencing

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.