cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
397 stars 132 forks source link

Why Method Name is Camel Case ? #60

Closed MR-MAP closed 4 years ago

MR-MAP commented 4 years ago

hi,

when my json is :

"/Api/Applications/New": { "get": { "tags": [ "Applications" ], "operationId": "GetNew", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ApplicationEditableVMFormlyVMFeedBack" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ApplicationEditableVMFormlyVMFeedBack" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ApplicationEditableVMFormlyVMFeedBack" } } } } } } }, ...

Generater method name is: getNew$json

how to change method name like ng-swagger : GetNew ?

luisfpg commented 4 years ago

That was actually a problem in ng-swagger-gen, as, by convention, methods in TypeScript / Angular should be camel case with first lower. In ng-openapi-gen that was fixed from the start. There's no way to change it.

questionablequestion commented 4 years ago

Hey @luisfpg, my generated method names are like apiLoginPost$Json, apiUsersPut$Json$Json, apiUsersIdGet$Json etc. How can I get rid of $... part? so I get only apiLoginPost (even more ideally without api prefix)?

Thanks in advance!