ASP.NET Core – How to change the JSON serialization settings

System.Text.Json is the default JSON serializer in ASP.NET Core. It uses the following default serialization settings: To change the settings at the service level for all controllers, call AddJsonOptions() in Startup.ConfigureServices() like this: Note: This example is passing in JsonStringEnumConverter, which makes JsonSerializer use the enum name instead of enum value. When you change the … Read more