python-jsonschema / python-jsonschema/referencing

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

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

Nobody has claimed this yet.

Dominant language
Python
Stars
53
Forks
27
Avg merge
1d 8h
Merged PRs (30d)
8

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.

Contributor guide

No contributing guide indexed for this repository

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.

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.