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
Describe the bug
Python's type specification no longer allows for function calls directly in type annotations, as discussed here. However, in an effort to keep the generator compatible with Pydantic 1, constructions such as x: conint() are still created, which is not actually valid Python.
I think there needs to be a Pydantic 2+ flag that can relax the need for backwards compatibility, and use newer more valid constructs like Annotated[]
Describe the bug
Python's type specification no longer allows for function calls directly in type annotations, as discussed here. However, in an effort to keep the generator compatible with Pydantic 1, constructions such as
x: conint()
are still created, which is not actually valid Python.I think there needs to be a Pydantic 2+ flag that can relax the need for backwards compatibility, and use newer more valid constructs like
Annotated[]
To Reproduce
Example schema:
Used commandline:
Actual output
Expected behavior
There should be a flag such as
--pydantic-2
or--pydantic 2+
that instead outputs:Version:
Additional context
Annotated
, although it doesn't discuss the context of deprecated syntaxThe text was updated successfully, but these errors were encountered: