set the naming strategy
https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Converters_StringEnumConverter.htm
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am creating an azure function with open api support that receives a query parameter, this parameter should only allow a list of values, so I am using an enum as is showing in the following code:
[FunctionName("GetInformation")]
[OpenApiOperation(operationId: "GetInformation", tags: new[] { "Information" })]
[OpenApiParameter(name: "System", In = ParameterLocation.Query, Required = true, Type = typeof(SystemEnum), Description = "System that generates information")]
public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = "api/information")] HttpRequest req, ILogger log)
{
}
To use the enum as string I am using the following enum
[Newtonsoft.Json.JsonConverter(typeOf(StringEnumConverter))]
public enum SystemEnum
{
SystemA,
SystemB,
SystemC
}
But when the azure function is launched, the system parameter appears with camelCase naming:
Also in the swagger.json specification appears with camelcase naming:
How can I change this behavior? Or What Do I need to change to the code to change the enum to pascalcase?
set the naming strategy
https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Converters_StringEnumConverter.htm