Hi,
I've tried the combination of
`[JsonStringEnumMemberConverterOptions(deserializationFailureFallbackValue: MyEnum.Unknown)]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum MyEnum
{
Unknown = 0,
[EnumMember(Value = "value1")]
ValidValue = 1
}`
When I use the following custom policy name :
public void ConfigureServices(IServiceCollection services) { services.AddControllers() .AddJsonOptions(options => { options.JsonSerializerOptions.Converters.Add(new JsonStringEnumMemberConverter(new UpperSnakeCaseNamingPolicy(), false)); options.JsonSerializerOptions.WriteIndented = true; });
Issues observed:
- once the fallback attribute is added converter is not working on serialize/deserialize
- fallback value is not being handled
Am I missing something in my implementation?