Hypermedia icon indicating copy to clipboard operation
Hypermedia copied to clipboard

Support `JsonPropertyNameAttribute` on Enum Deserialization

Open hughesjs opened this issue 2 years ago • 1 comments

This one, again, might be a bit niche or might not be wanted. However, I often find I want to deserialise a string to an enum using a custom value through an attribute, like:

[EnumMember(Value = "Pld Frag Deb")]
PayloadFragmentationDebris,

As it stands, the simple Enum.Parse() used in EnumConverter doesn't (AFAICT) support this

hughesjs avatar May 28 '22 10:05 hughesjs

#33 was reverted. As was #34, so this is now reopened, as the solution proposed in this PR would require a .NET 6 upgrade.

hughesjs avatar Jul 24 '22 01:07 hughesjs