OpenAPI Schema Casing #59375
-
Hey. I'm looking for a bit of advice. I've created a new Web API using .NET 9. I'm using the new OpenAPI generator, Scalar API interface and FastEndpoints. FastEndpoints is configured to serialize/deserialize request and response bodies with the SnakeCaseLower naming policy. However, I'm noticing the schemas generated by OpenAPI continue to use camelCase for the property names. I've looked through the available documentation and I can't seem to find any hints how to configure the schema generation to use SnakeCaseLower. I've tried to mess with the schema transformers but without much luck. Has anyone tackled this issue already? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Stumbled across the solution in another issue. Once I added the following configuration the OpenAPI schema was generated with the correct casing. builder.Services
.ConfigureHttpJsonOptions(options =>
{
options.SerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower;
}) |
Beta Was this translation helpful? Give feedback.
Stumbled across the solution in another issue. Once I added the following configuration the OpenAPI schema was generated with the correct casing.