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

Alias is being applied to typescript type #2

Closed
brysgo opened this issue Dec 2, 2020 · 1 comment · May be fixed by #18
Closed

Alias is being applied to typescript type #2

brysgo opened this issue Dec 2, 2020 · 1 comment · May be fixed by #18

Comments

@brysgo
Copy link

brysgo commented Dec 2, 2020

Thanks for this utility, it is pretty neat. One thing I noticed was that if we have an alias on the pydantic model (e.g. to map mongodb's _id to an id field on the model):

  id: Optional[PyObjectId] = Field(alias='_id', default_factory=PyObjectId)

The typescript type uses _id instead of id, even though the field name as far as the API is concerned is id.

Since I'm not sure about the internals of this project, I'm not sure if it is possible to fix, but I figured I would leave it here in case it is.

@brysgo
Copy link
Author

brysgo commented Dec 2, 2020

Closing this for now because I think the project I'm referring to might be using alias wrong

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 a pull request may close this issue.

1 participant