Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used?
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
When generating a client for a typescript-angular, some function definitions have duplicate argument names despite ensureUniqueParams
being set to true
.
openapi-generator version
4.3.0. This is my first time using this generator, so I cannot tell if it is a regression.
OpenAPI declaration file content or url
This was observed while generating a client for https://raw.githubusercontent.com/netdata/netdata/master/web/api/netdata-swagger.yaml.
Command line used for generation
openapi-generator generate -i https://raw.githubusercontent.com/netdata/netdata/master/web/api/netdata-swagger.yaml -g typescript-angular -o out -c cfg/swagger-gen-config.json --skip-validate-spec
Note: the --skip-validate-spec
is needed because there are some missing definitions in the swagger file. Despite this, the client is still successfully generated despite the issue being reported.
The contents of cfg/swagger-gen-config.json
is:
{
"modelPropertyNaming": "original",
"ensureUniqueParams": true
}
Steps to reproduce
- Create the configuration file detailed above.
- Run the command listed above.
- Once the client is generated, navigate to
out/api/default.service.ts
.
4: Search for a function namedbadgeSvgGet
ordataGet
. They will have two parameters namedoptions?
. One is from the API definition, the other is for the Angular httpClient options.
The expectation is that having the ensureUniqueParams
flag set will rename one of the generated options?
parameters to something else.
Related issues/PRs
I have not found any another issues or PRs.
Suggest a fix
It seems like the generator is not taking the parameters generated for the Angular HttpClient into account when handling the ensureUniqueParams
logic.