Skip to content
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

Resolve import aliases #7

Merged
merged 8 commits into from
Apr 27, 2023
Merged

Resolve import aliases #7

merged 8 commits into from
Apr 27, 2023

Conversation

povilasb
Copy link
Collaborator

Now pydantic2zod is capable of resolving aliases and recursing into dependent modules respectively:

from pydantic import BaseModel

from .all_in_one import Class as Cls


class Module(BaseModel):
    name: str
    classes: list[Cls]

It's a builtin module - we won't find any pydantic models there :)
Will help to uniquely identify the models even when the name is the same.
Will enable us to make better decisions about the generated zod model names.
@povilasb povilasb merged commit b67a25f into main Apr 27, 2023
@povilasb povilasb deleted the import-alias branch April 27, 2023 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant