There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
StringEnumConverter could replace hyphens with underscores
When interacting with APIs we don't have control over, we sometimes run into a discrete set of values that includes hyphens (aka dashes). It would be nice if the StringEnumConverter automatically converted them to underscores before deserializing.
For serialization it would be quite a bit more challenging because it's not obvious if an underscore is supposed to be a hyphen. I'm not requesting that the serialization case be handled but a possible solution would be to add an enum class attribute called
"Hyphenate" or something similar which would instruct the serializer to replace underscores with hyphens.