-
-
Notifications
You must be signed in to change notification settings - Fork 403
fix: RootModel future annotations and extra field #2478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: RootModel future annotations and extra field #2478
Conversation
CodSpeed Performance ReportMerging #2478 will not alter performanceComparing Summary
|
|
Any update on this? I think it's still an issue |
|
This PR has no reproducible example. It's going to be hard to validate it. A previous version of datamodel-code-generator has issues with same-name objects (see #2460). It has been fixed in v0.33.0 by #2461 @benomahonyTW could you check if v0.33.0 fixed your issue? If not, could you open an issue with a reproducible example? Thanks! |
|
@ilovelinux Yeah verified this doesn't work with v0.33.0. Works perfectly when I pass
Looking at my environment is pydantic_ai interfering with the pydantic version detection???? Command run: |
|
@benomahonyTW there's no Pydantic version detection in datamodel-code-generator. See #2466 |
|
Wouldn't it make sense to keep v2 as default and drop v1 support at some point? I feel this is probably the expected behaviour from all new users? |
|
@benomahonyTW we are discussing that in issue #2466. Please let's continue there so we don't pollute this MR. We are off-topic 🙂 |

RootModelshould not have the fieldextraset in pydantic:https://docs.pydantic.dev/latest/errors/usage_errors/#root-model-extra
RootModeldoes not seem to support future annotations, so quotes must be used:pydantic/pydantic#7967