Open tandasima opened 4 years ago
@tandasima did you find a solution to this? I am also looking for a case insensitive resolver.
Looks like default EnumFormatter implementation doesn't support that.
@gorillapower I ended up writing my own resolver.
Does Utf8json support converting strings to Enums case insensitive? So far it looks like it doesn't but I'm not entirely sure.
I would like to be able to deserialize
"cat", "CAT", "caT"...
toPet.Cat
enum.I know in Enums
Cat
andcat
are different, however, its not in my use-case and would like whatever case that comes in the payload to match the onlyCat
in the enum.Basically, I would like to accomplish something similar to this:
https://stackoverflow.com/questions/2441290/javascriptserializer-json-serialization-of-enum-as-string
I'd really appreciate any guidance if this is possible.