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

feature request: support Enum by Value #2

Open
sanzoghenzo opened this issue Mar 14, 2022 · 2 comments · May be fixed by #3
Open

feature request: support Enum by Value #2

sanzoghenzo opened this issue Mar 14, 2022 · 2 comments · May be fixed by #3

Comments

@sanzoghenzo
Copy link

Hi there!

First of all, kudos for your great work!

I started to use this library, and my data structure serializes the enums using their values instead of the name.

Are you willing to accept a PR to allow the parsing of the enum both by name or value?

sanzoghenzo added a commit to sanzoghenzo/validobj that referenced this issue Mar 14, 2022
@sanzoghenzo sanzoghenzo linked a pull request Mar 14, 2022 that will close this issue
@Zaharid
Copy link
Owner

Zaharid commented Apr 9, 2022

I have added a feature to define custom parsers, documented here

https://validobj.readthedocs.io/en/latest/custom.html

It should allow to more or less easily implement this kind of logic externally.

@sanzoghenzo
Copy link
Author

Thanks, I will try that ASAP.

This is also handy for numpy arrays and pydantic models!

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.

2 participants