cyclosproject / ng-openapi-gen

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

Is there any config to set for having same method in different service? #165

Closed hamidamel closed 3 years ago

hamidamel commented 3 years ago

We have a lot of controllers in the back-end that have the same method name. so the generator adds a sequential number to the end of each method. for example, we have two controllers with createApp method, after we call the generator, We will have createApp1 method in the second one.

app-controller-api.service.ts

/**
   * This method provides access to only to the response body.
   * To access the full response (for headers, for example), `createApp1$Response()` instead.
   *
   * This method sends `application/json` and handles request body of type `application/json`.
   */
  createApp1(params: {
    body: DeveloperAppRequest
  }): Observable<CreateDeveloperAppResponse> {

    return this.createApp1$Response(params).pipe(
      map((r: StrictHttpResponse<CreateDeveloperAppResponse>) => r.body as CreateDeveloperAppResponse)
    );
  }

application-controller-api.service.ts


/**
   * This method provides access to only to the response body.
   * To access the full response (for headers, for example), `createApp$Response()` instead.
   *
   * This method sends `application/json` and handles request body of type `application/json`.
   */
  createApp(params?: {
    body?: DeveloperAppsCreateRequest
  }): Observable<CreateResponse> {

    return this.createApp$Response(params).pipe(
      map((r: StrictHttpResponse<CreateResponse>) => r.body as CreateResponse)
    );
  }