- ABP Framework version: v8.1.3
- UI Type: Blazor Server
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): no
- Exception message and full stack trace:
- Steps to reproduce the issue:
When creating auto API controllers, the properties of complex types that are populated from the query string default to PascalCase
. How can I change this to camelCase
or kebab-case
?
5 Answer(s)
-
0
hi
Do you mean
localhost/api/users?skip-count=10&max-result-count=10
? -
0
Yes.
-
0
hi
You can try to replace the
ConventionalRouteBuilder
servicehttps://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Conventions/ConventionalRouteBuilder.cs#L13
https://docs.abp.io/en/abp/latest/API/Auto-API-Controllers#version-3-x-style-route-calculation
-
0
Ok thanks. Did a bit more investigating. It looks like the default ASP.NET Core model binding works for any casing of query string parameters. So you just need to tell Swagger to use camel casing:
SwaggerGenOptions.DescribeAllParametersInCamelCase()
so they appear correctly in the generated API docs. -
0
Great