Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete PascalCase transformation for C# clients #4699

Open
decevy opened this issue May 21, 2024 · 1 comment
Open

Complete PascalCase transformation for C# clients #4699

decevy opened this issue May 21, 2024 · 1 comment
Labels
type:feature New experience request
Milestone

Comments

@decevy
Copy link

decevy commented May 21, 2024

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

@decevy decevy added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels May 21, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Kiota May 21, 2024
@andrueastman andrueastman moved this from Needs Triage 🔍 to Todo 📃 in Kiota May 29, 2024
@andrueastman andrueastman added this to the Kiota v2.0 milestone May 29, 2024
@andrueastman andrueastman removed the status:waiting-for-triage An issue that is yet to be reviewed or assigned label May 29, 2024
@andrueastman
Copy link
Member

Thanks for raising this @decevy

We'll probably hold this for now for the next major version of Kiota as these changes would be breaking for existing clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New experience request
Projects
Status: Todo 📃
Development

No branches or pull requests

2 participants