Skip to content

Complete PascalCase transformation for C# clients #4699

@decevy

Description

@decevy

Is your feature request related to a problem? Please describe the problem.

Hello,

I used Kiota to generate a C# api client out of a Django openapi specification. It unfortunately still generates quite some PascalCase/snake_case mixtures in naming.

Example specification:
{ "openapi": "3.0.0", "info": { "title": "Sample Users API", "description": "This API manages user information with more explicitly snake_case paths", "version": "1.0.0" }, "servers": [ { "url": "https://api.sample.com/v1", "description": "Primary production server" } ], "paths": { "/users/user_details/{user_id}": { "get": { "summary": "Retrieve specific user details", "description": "Fetches details of a specific user by user ID", "operation_id": "get_specific_user_details", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The unique identifier for the user", "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Successful response with user details", "content": { "application/json": { "schema": { "type": "object", "properties": { "user_id": { "type": "integer", "description": "Unique identifier for the user" }, "user_name": { "type": "string", "description": "The user's name" } } } } } } } } }, "/users/{user_id}/update_role": { "post": { "summary": "Update a user's role", "description": "Updates the role of a specific user by user ID", "operation_id": "update_user_role", "parameters": [ { "name": "user_id", "in": "path", "required": true, "description": "The unique identifier for the user", "schema": { "type": "integer" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "new_role": { "type": "string", "enum": [ "admin_role", "user_role", "guest_role" ], "description": "The new role of the user" } }, "required": [ "new_role" ] } } } }, "responses": { "200": { "description": "Role updated successfully" }, "400": { "description": "Invalid input provided" } } } } } }

Folders & Classes in snake_case:
image

Namespaces:
image

Properties, inner classes:
image

Enums and enum-values:
image

Perhaps there are more scenarios. I tried to fix it myself but with the time I have the C# refiner class is too complicated to add changes to.

Client library/SDK language

Csharp

Describe the solution you'd like

It would be great to have the C# refiner Class extended with more snake_case to PascalCase renaming

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    New📃

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions