Skip to content

Add the ability to modify the syntax of the generated service method names #1915

Description

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions