CamelCase not working in net core 6 web api.
CamelCase not working in net core 6 web api
30907-Nov-2023
Updated on 08-Nov-2023
Home / DeveloperSection / Forums / CamelCase not working in net core 6 web api
CamelCase not working in net core 6 web api.
Aryan Kumar
08-Nov-2023If camelCase property names are not being used in the JSON responses of your ASP.NET Core 6 Web API, it's likely because the default JSON serialization settings are set to use PascalCase by default. To make your API use camelCase property names, you can configure the JSON serialization settings as follows:
Either of the above methods will configure the JSON serialization settings to use camelCase for property names. Your API will now return JSON responses with camelCase property names. Make sure you have added the necessary Microsoft.AspNetCore.Mvc.NewtonsoftJson NuGet package and added it to your project if you prefer using Newtonsoft.Json for serialization.