Support datamodel-code-generator 0.59#589
Conversation
|
📚 Docs Preview: https://pr-589.fastapi-code-generator.pages.dev |
WalkthroughThe PR updates the parser to handle boolean schemas in discriminator variants, bumps the ChangesBoolean Discriminator Variant Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
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 #589 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 17
Lines 1351 1357 +6
Branches 139 140 +1
=========================================
+ Hits 1351 1357 +6
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:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pyproject.toml`:
- Line 31: The dependency bump to datamodel-code-generator (>=0.59,<0.60)
introduces breaking codegen changes; regenerate all generated models (the code
produced by datamodel-code-generator), run snapshot/unit tests, and update any
custom templates to account for the new flags and attributes — specifically
update template logic that relied on field.required to use
field.use_default_with_required where appropriate, adapt templates/consumers of
RootModel/payload changes, remove usages/imports of internal classes
ValidatedDefault and WrappedDefault, handle TypedDict import deduplication, and
adjust dict key handling for patternProperties/propertyNames; after regen, fix
any typing/validation diffs and re-run tests to confirm all snapshots and type
checks pass.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d8ef0a02-875d-466b-b6f5-3d1af885691e
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
fastapi_code_generator/parser.pypyproject.tomltests/data/expected/openapi/default_template/shadowed_imports/main.pytests/test_parser.py
Breaking Change AnalysisResult: Breaking changes detected Reasoning: The PR contains two breaking changes: (1) Generated code output changed - the shadowed import aliasing behavior from datamodel-code-generator 0.59 now uses direct type references instead of Content for Release NotesCode Generation Changes
Python or Dependency Support Changes
This analysis was performed by Claude Code Action |
|
🎉 Released in 0.7.0 This PR is now available in the latest release. See the release notes for details. |
Summary
Validation
uv run pytest./scripts/lint.shSummary by CodeRabbit
Bug Fixes
Tests
Chores