Open Closed

Configure naming policy for named parameters on API controllers #7469


User avatar
0
phil@travelengine.com.au created
  • 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?

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Do you mean localhost/api/users?skip-count=10&max-result-count=10?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    phil@travelengine.com.au created

    Yes.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to replace the ConventionalRouteBuilder service

    https://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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    phil@travelengine.com.au created

    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Great

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.