Fix reuse-model generating type aliases instead of class inheritance#2853
Fix reuse-model generating type aliases instead of class inheritance#2853
Conversation
📝 WalkthroughWalkthroughThe changes update expected test output files to reflect the conversion of generated type aliases to explicit subclass declarations. Two test files now show type references being generated as proper subclass definitions rather than simple aliases, maintaining inheritance while establishing distinct types. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
🔇 Additional comments (3)
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. Comment |
|
📚 Docs Preview: https://pr-2853.datamodel-code-generator.pages.dev |
CodSpeed Performance ReportMerging #2853 will not alter performanceComparing
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2853 +/- ##
=======================================
Coverage 99.50% 99.50%
=======================================
Files 90 90
Lines 14824 14824
Branches 1777 1777
=======================================
Hits 14750 14750
Misses 38 38
Partials 36 36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Breaking Change AnalysisResult: Breaking changes detected Reasoning: This PR changes the code generation output for Pydantic v2 when using the --reuse-model option. Previously, when a model would just be an empty subclass (no additional fields, config, or description), the template would generate a type alias (e.g., Content for Release NotesCode Generation Changes
Custom Template Update Required
This analysis was performed by Claude Code Action |
|
🎉 Released in 0.51.0 This PR is now available in the latest release. See the release notes for details. |
Fixes: #2639
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.