You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Because Pydantic2 broke... everything, my org still uses Pydantic 1 until everything can be refactored. Because Pydantic 2 had all the breaking changes, they left the legacy package in the new "pydantic.v1" package inside the current deploy to allow for more piecemeal migrations rather than "all-or-nothing." So, I can change all my imports from "from pydantic.xxx" to "from pydantic.v1.xxx" and they will work without breaking even if I pull in the 2.x Pydantic library, allowing me to slowly migrate as I can.
However, that change in import statement is not captured in my generated models from DMCG, so they fail imports for classes like the field types at runtime.
Describe the solution you'd like
A new command line option "-add-v1-to-imports" that literally just changes "from pydantic" to "from pydantic.v1" in generated models for backward compatibility.
Describe alternatives you've considered
I considered writing a manual post-processor for generated files.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Because Pydantic2 broke... everything, my org still uses Pydantic 1 until everything can be refactored. Because Pydantic 2 had all the breaking changes, they left the legacy package in the new "pydantic.v1" package inside the current deploy to allow for more piecemeal migrations rather than "all-or-nothing." So, I can change all my imports from "from pydantic.xxx" to "from pydantic.v1.xxx" and they will work without breaking even if I pull in the 2.x Pydantic library, allowing me to slowly migrate as I can.
However, that change in import statement is not captured in my generated models from DMCG, so they fail imports for classes like the field types at runtime.
Describe the solution you'd like
A new command line option "-add-v1-to-imports" that literally just changes "from pydantic" to "from pydantic.v1" in generated models for backward compatibility.
Describe alternatives you've considered
I considered writing a manual post-processor for generated files.
The text was updated successfully, but these errors were encountered: