For some reason, by default, the System.Text.json library does not convert strings into enums.
To overcome this, I usually configure it this way:
services.AddControllers()
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.PropertyNamingPolicy = null;
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
});
Tags
ASP .NET core