Skip to content

typescript-angular2: Make the api suffix configurable #8281

Description

@tomvangreen

I'd be happy to have a look if I'm able to provide a pull request for this feature request, if nobody is already working on this. I had a look in the issue tracker but there was only a request for changing it from Api to Service and another unrelated request for adding a possiblity to define a suffix in the JAXRs generator.

Description

In earlier versions the generated service classes were suffixed with "Api". Recently this has changed to be "Service". While this adheres to angular standards it sometimes can cause collisions with existing services. For me it would make sense to use the api suffix because of multiple reasons.

  1. We avoid collisions. If I have a UserService in my client and somebody introduces a UserApi, suddenly I need to alias my imports in order to use both services in one place.

  2. Having the .api file extensions and the Api suffix in the class name, it makes it more clear to the developer, that this is not a normal service. If you work in our project then you know that apis are always generated.

Suggest a fix/enhancement

Introduce a configuration for typescript-angular2 which lets you specify a different suffix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions