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
Make JsonStringEnumConverter support nullable enums #30947
Comments
cc @JeremyKuhne |
5.0? Is there any chance we can make it earlier, if I contribute with a PR? 👼 |
It would be great if you'd like to submit a fix for this against master and we can evaluate whether it makes sense to port it to 3.1 based on risk/complexity and consumer need. Let me know if you need any help with that and definitely ping me on your PR for review whenever you get the chance to work on the fix :) Can you explain your scenario/use case which is being blocked by the lack of this feature? I also want to try and see if there is a feasible workaround for nullable enums (either via a custom converters or creating your own |
Thanks for the offer - in that case, perhaps you can help with dotnet/corefx#41344? |
We are also blocked from using |
I have the same problem, had to use Newtonsoft because of that. |
While this isn't the most elegant solution, it does serve as a workaround until this gets sorted.
and you can attach it to your property by decorating it with this
|
To slightly improve the performance of the method above, we can remove the
the try and catch is a bit expensive for something that can be solved with |
For anyone blocked by this, here's a NuGet package with a converter (JsonStringEnumMemberConverter) we can use ahead of the 5.0 drop: Macross.Json.Extensions Supports nullable enum types and adds EnumMemberAttribute support. |
This is fixed for 5.0 following #32006. |
Right now, the
JsonStringEnumConverter
converter does not support nullable enums.I think it should.
The text was updated successfully, but these errors were encountered: