Note, that in this example all enums will be serialized and deserialized as with EnumResolver.Default but that data is in CamelCase. So, the second Formatter wasn't worked properly.
But, if you change the order of resolvers, everything would be applied (and CamelCase also).
Ex.
Utf8Json.Resolvers.CompositeResolver.Create(EnumResolver.UnderlyingValue, StandardResolver.CamelCase)
The full example of code:
.AddMvcOptions(options =>
{
//remove default JsonFormatter from Mvc
options.OutputFormatters.RemoveType<SystemTextJsonOutputFormatter>();
options.InputFormatters.RemoveType<SystemTextJsonInputFormatter>();
var resolver = Utf8Json.Resolvers.CompositeResolver.Create(EnumResolver.UnderlyingValue, StandardResolver.CamelCase);
options.OutputFormatters.Add(new JsonOutputFormatter(resolver));
options.InputFormatters.Add(item: new JsonInputFormatter(resolver));
})
I've set of Resolvers which I want to pass for configuring OutputFormatters and InputFormatters.
Ex. Utf8Json.Resolvers.CompositeResolver.Create(StandardResolver.CamelCase, EnumResolver.UnderlyingValue);
Note, that in this example all enums will be serialized and deserialized as with EnumResolver.Default but that data is in CamelCase. So, the second Formatter wasn't worked properly.
But, if you change the order of resolvers, everything would be applied (and CamelCase also). Ex. Utf8Json.Resolvers.CompositeResolver.Create(EnumResolver.UnderlyingValue, StandardResolver.CamelCase)
The full example of code: