Skip to content

Address review feedback for recursive/dynamic ref support#2985

Merged
koxudaxi merged 8 commits intomainfrom
fix/recursive-dynamic-ref-support
Feb 13, 2026
Merged

Address review feedback for recursive/dynamic ref support#2985
koxudaxi merged 8 commits intomainfrom
fix/recursive-dynamic-ref-support

Conversation

@koxudaxi
Copy link
Owner

@koxudaxi koxudaxi commented Feb 10, 2026

Fixes review comments from #2982

Summary by CodeRabbit

  • Documentation

    • Updated JSON Schema feature compatibility information by removing entries for $recursiveRef, $recursiveAnchor, $dynamicRef, and $dynamicAnchor from the unsupported features list.
  • Bug Fixes

    • Improved anchor index handling to prevent duplicate entries during JSON Schema parsing.

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

Support for deprecated JSON Schema anchor features ($recursiveRef/$recursiveAnchor and $dynamicRef/$dynamicAnchor) has been removed from the codebase. The parser no longer builds indexes for these anchor types, and documentation reflecting their unsupported status has been deleted.

Changes

Cohort / File(s) Summary
Documentation Updates
docs/supported_formats.md
Removed two unsupported feature rows from the JSON Schema features table: $recursiveRef / $recursiveAnchor and $dynamicRef / $dynamicAnchor.
JSON Schema Parser
src/datamodel_code_generator/parser/jsonschema.py
Removed anchor index construction logic for $recursiveAnchor and $dynamicAnchor in both root object and definitions processing. Added duplicate anchor prevention check in _build_anchor_indexes_.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

Old anchors drift away like clouds,
$recursive whispers fade out loud,
Dynamic refs no longer proud,
The parser hops through cleaner shrouds,
✨ Lighter code, the rabbit's crowed! 🐰

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing support for recursive/dynamic ref features from documentation and code based on review feedback.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/recursive-dynamic-ref-support

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Generated by GitHub Actions
@github-actions
Copy link
Contributor

📚 Docs Preview: https://pr-2985.datamodel-code-generator.pages.dev

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 10, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 11 untouched benchmarks
⏩ 98 skipped benchmarks1


Comparing fix/recursive-dynamic-ref-support (7b96f30) with main (4be7699)

Open in CodSpeed

Footnotes

  1. 98 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4be7699) to head (7b96f30).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2985   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           94        94           
  Lines        17959     17961    +2     
  Branches      2076      2077    +1     
=========================================
+ Hits         17959     17961    +2     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@koxudaxi koxudaxi merged commit fadd36d into main Feb 13, 2026
39 checks passed
@koxudaxi koxudaxi deleted the fix/recursive-dynamic-ref-support branch February 13, 2026 08:29
@github-actions
Copy link
Contributor

Breaking Change Analysis

Result: No breaking changes detected

Reasoning: PR #2985 contains only bug fixes and documentation cleanup: (1) A bug fix to prevent duplicate entries in the recursive anchor index by checking if ref_path not in anchors before appending, (2) Removal of inline comments for code cleanup, (3) Documentation updates that removed incorrectly placed entries from the unsupported features table. None of these changes affect generated code output, CLI/API interfaces, default behavior, template requirements, or Python version support. The duplicate prevention is a defensive fix that maintains the same behavior for valid schemas.


This analysis was performed by Claude Code Action

@github-actions
Copy link
Contributor

🎉 Released in 0.54.0

This PR is now available in the latest release. See the release notes for details.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments