-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
internal sealed class EnumConverter<T>.Read() #63893
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json Issue DetailsDescriptionThe Read method should consider the
Reproduction Steps
Expected behaviorI have a When writing values out, all good.
When reading value from Actual behaviorCurrently, it fails:
Regression?No response Known WorkaroundsWriting my own EnumConverter and override the the ConfigurationNo response Other informationNo response
|
In this function, should try and lookup the get the value from any
if fact this line "cheats" into incorrectly accepted "camelCasePolicy"; |
This seems to do the trick...
|
Duplicate of #31619 |
Closing as dup. |
Description
The Read method should consider the
_namingPolicy
when reading a value the source string; as per the WriteReproduction Steps
Expected behavior
I have a
DictionaryLookupNamingPolicy
that extract the[EnumMember(Value="xx"]
from the Enum.When writing values out, all good.
When reading value from
{ "value": "F" }
it would expect to return aDemoSpecial
.Actual behavior
Currently, it fails:
The JSON value could not be converted to <namespace>.SpecialEnum. Path: $.value
Regression?
No response
Known Workarounds
Writing my own EnumConverter and override the the
Read
methodConfiguration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: