-
Notifications
You must be signed in to change notification settings - Fork 36
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
Error when TypeAlias is used #34
Comments
CustomType is (since version 3.9 at least) actually an instance of type The pydantic maintainers encountered this early 2021 and fixed it in their |
I modified the function to def is_concrete_pydantic_model(obj) -> bool:
"""
Return true if an object is a concrete subclass of pydantic's BaseModel.
'concrete' meaning that it's not a GenericModel.
"""
return isinstance(obj, ModelMetaclass) and I can generate typescript. |
Hi and thank you for this package!
I would like to report a bug with version 1.0.10 and Python version 3.10.
Assume we have this Python file:
Now if I run
pydantic2ts --module test.py --output ./test.ts
I get the following error:Note that
CustomType
is not even used in the PydanticModel. Still, if I comment out the definition of CustomType, the error disappears.The text was updated successfully, but these errors were encountered: