Fix snake case array discriminator#3125
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughNormalize discriminator property names during root-model collapse by validating them with ModelResolver.get_valid_field_name_and_alias; add a golden Pydantic v2 artifact and a regression test for discriminator-in-array snake_case behavior; adjust a documentation example's snippet formatting. ChangesDiscriminator Snake-Case Normalization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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-3125.datamodel-code-generator.pages.dev |
Merging this PR will not alter performance
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3125 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 88 88
Lines 18536 18541 +5
Branches 2141 2141
=========================================
+ Hits 18536 18541 +5
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: No breaking changes detected Reasoning: This PR fixes a bug where discriminator field names in collapsed root models (array items) were not normalized through This analysis was performed by Claude Code Action |
|
🎉 Released in 0.57.0 This PR is now available in the latest release. See the release notes for details. |
Fixes: #3091
Summary by CodeRabbit
Documentation
Bug Fixes
Tests