openapi-typescript-codegen
openapi-typescript-codegen copied to clipboard
Add the ability to modify the syntax of the generated service method names
Currently, all endpoints in my API are prefixed with /api, which results in the generated methods following the pattern <ServiceName>.<Method><EndpointURI> e.g. BookService.getApiBooks(). I propose introducing a feature that allows customization of this behavior.
Suggested Feature
Implement a new CLI option: --stripEndpointPrefixFromMethodNames.
Example Usage
openapi-generator-cli generate -i your-api-spec.yaml -g typescript --stripEndpointPrefixFromMethodNames "api"
This would generate the following code for endpoint /api/books
BookService.getBooks() instead of BookService.getApiBooks()