You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case of using a custom converter policy for example: options.Converters.Add(new JsonStringEnumMemberConverter(new UpperSnakeCaseNamingPolicy(), false));
class public enum Days
{
SundayDay,
MondayDay,
FridayDay
}
In POST action , when trying to deserialize "SUNDAY_DAY " the input can be :
"Sunday_Day"
"SUnday_DAY"
"sunday_day"
the result of deserialize will be correct -> Days.SundayDay
We might want to support backward compatibility to deserialize same enum type option to itself.
So in POST action , when trying to deserialize "SundayDay " to -> Days.SundayDay it will work.
Adding this line of code, will accomplish that:
_TransformedToRaw[typedValue.ToString()] = new EnumInfo(name, typedValue, rawValue);
Please consider adding this capability to the code.
Thanks!
The text was updated successfully, but these errors were encountered:
In case of using a custom converter policy for example:
options.Converters.Add(new JsonStringEnumMemberConverter(new UpperSnakeCaseNamingPolicy(), false));
In POST action , when trying to deserialize "SUNDAY_DAY " the input can be :
the result of deserialize will be correct -> Days.SundayDay
We might want to support backward compatibility to deserialize same enum type option to itself.
So in POST action , when trying to deserialize "SundayDay " to -> Days.SundayDay it will work.
Adding this line of code, will accomplish that:
_TransformedToRaw[typedValue.ToString()] = new EnumInfo(name, typedValue, rawValue);
Please consider adding this capability to the code.
Thanks!
The text was updated successfully, but these errors were encountered: