-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Multiple aliases for field #176
Comments
Hi @CralixRaev This would be a useful feature. I think reusing existing The field option would accept Would you like to work on it? It will be pretty straightforward after upcoming merge of the related PR: |
A related idea is to have the alias(es) depend on the @Fatal1ty Do you think this would be a reasonable feature to have? edit: A less elegant thing would be to handle such things via |
@real-or-random In short, I like your idea. I also thought about configuring aliases in dialects but in a more complex scenario. Right now, it's not possible to use the If you'd like to contribute, we could start with the simple scenario and add support for a path syntax later. |
Actually, no specific reason here. It was requested just for serialization. |
Thanks for the swift reply! I might need this in the future, but it's further down the road. I'm still in the process of figuring out whether this lib is the right for me, see my other issue. ;) |
Thank you for your feedback and illustrative examples with German words. This will help me to prioritize what needs to be done first. |
Is your feature request related to a problem? Please describe.
Sometimes you need to add multiple aliases for one field (e.g. one endpoint in poorly-designed api returns id with name "id", and another one returns it as "product_id")
Describe the solution you'd like
Add an feature to deserialize one field by multiple different aliases
Describe alternatives you've considered
Now i just made two different fields in my dataclass, and it's very confusing
The text was updated successfully, but these errors were encountered: