OpenAPITools / OpenAPITools/openapi-generator

angular-typescript: the generated methods(representing the APIs) in the controller have a number suffix

Open
#7,602 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

I have an exposed file from spring boot server
and I am using this script to generate a typescript angular client

openapi-generator-cli generate -g typescript-angular -i ./src/app/data/open-api.json -o ./src/app/data/build/openapi

there are duplicated api names among the system

simple structure

Controller1 : [get,list,delete,... ....]
Controller2 : [get,list,delete,... ....]
.....

the generated classes looks like

Controller1Service{
public get1 ....
public list1 .....
}
Controller2Service{
public get2 ....
public list2 .....
}

but the functions are unique in the same controller and the generator still adding numbers to them

openapi-generator version

4.3.1 using npm cli

OpenAPI declaration file content or url
Command line used for generation

openapi-generator-cli generate -g typescript-angular -i ./src/app/data/open-api.json -o ./src/app/data/build/openapi

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the stated openapi-generator-cli command with the reported open-api.json and inspect the generated Controller1Service and Controller2Service methods. Trace the typescript-angular generator or templates responsible for method naming, then verify that names unique within each controller are generated without unnecessary number suffixes.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, openapi, spring-boot, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.