fix: wrap RootModel primitive defaults with default_factory#2714
fix: wrap RootModel primitive defaults with default_factory#2714
Conversation
WalkthroughUpdated default handling for Pydantic models: added a centralized Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (13)
🚧 Files skipped from review as they are similar to previous changes (6)
🧰 Additional context used🧬 Code graph analysis (4)tests/data/expected/main/openapi/referenced_default.py (2)
src/datamodel_code_generator/model/pydantic/base_model.py (4)
tests/data/expected/main/jsonschema/root_model_default_value_no_annotated.py (1)
src/datamodel_code_generator/model/base.py (1)
🪛 Checkov (3.2.334)tests/data/openapi/root_model_default_primitive.yaml[high] 1-20: Ensure that the global security field has rules defined (CKV_OPENAPI_4) ⏰ 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). (12)
🔇 Additional comments (8)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2714 +/- ##
=======================================
Coverage 99.34% 99.34%
=======================================
Files 81 82 +1
Lines 11534 11555 +21
Branches 1387 1391 +4
=======================================
+ Hits 11458 11479 +21
Misses 45 45
Partials 31 31
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:
|
CodSpeed Performance ReportMerging #2714 will not alter performanceComparing Summary
Footnotes
|
57215f7 to
1ffdcf1
Compare
1ffdcf1 to
525cdfd
Compare
Fixes: #2027
Summary by CodeRabbit
Bug Fixes
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.