-
Notifications
You must be signed in to change notification settings - Fork 413
[Feature Request] Case insensitive parsing of enums #927
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
Comments
Any news on this? |
Turns out this is more gnarly to do that you'd think. It's in my backlog, but not super high priority. Friendly reminder: I'm the only maintainer of this package – and purely in my free time. |
it would be great to support this even for keys |
This could be realized by supporting the more general feature #1036. |
@t-beckmann – you can also do this now by just adding |
Should cover most cases, except for enums one can not modify for some reason, but that's rare. Could be closed...? |
Due to inconsistencies in the data sources my app needs to handle various variants of enum representations e.g.:
I wish there was a way to tell json_serializable to ignore the case differences and parse these values to
MyEnum.value
.The API I would love to see could be:
In Dart:
and the generated code would then call
toString().toLowerCase()
on the value being passed toenumDecodeNullable
:The text was updated successfully, but these errors were encountered: