fix: RootModel future annotations and extra field #2478
fix: RootModel future annotations and extra field #2478MarekZbysinskiQC wants to merge 1 commit intokoxudaxi:mainfrom
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