Yes, you can configure the default Json.Net settings, as Lodewijk explained. But the web API uses its own settings, and you have to set them separately.
Web API (.NET Core)
services.AddMvc(opts => { var jsonFormatter = (JsonOutputFormatter) opts.OutputFormatters .First(formatter => formatter is JsonOutputFormatter); jsonFormatter.PublicSerializerSettings.Converters.Add(new StringEnumConverter()); });
Web Interface (.NET Framework)
var config = GlobalConfiguration.Configuration; config.Formatters.JsonFormatter.SerializerSettings.Converters .Add(new StringEnumConverter());
Andrei
source share