Generated OpenAPI document uses PascalCase instead of camelCase on requestBody properties
Hello, I'm still new to .NET and I've been trying to solve this issue for 2 days now.
I'm using .NET's
Microsoft.AspNetCore.OpenApi
package for generating OpenAPI document. It automatically serializes all model properties to camelCase, except for requestBody.
I have an upload controller that receives form data:
and the model looks like this:
I tried using [JsonPropertyName("title")]
decorator on model properties, but that doesn't seem to affect the generated document. Also tried specifying options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
as AI keeps suggesting, but that doesn't seem to work either.
Does anyone know how I could solve this issue?1 Reply
Sorry for bump, but does no one really know?