Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ensureUniqueParams not working for typescript-angular client #6032

Closed
5 of 6 tasks
dpsy4 opened this issue Apr 23, 2020 · 2 comments
Closed
5 of 6 tasks

[BUG] ensureUniqueParams not working for typescript-angular client #6032

dpsy4 opened this issue Apr 23, 2020 · 2 comments

Comments

@dpsy4
Copy link

dpsy4 commented Apr 23, 2020

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
  1. Create the configuration file detailed above.
  2. Run the command listed above.
  3. Once the client is generated, navigate to out/api/default.service.ts.
    4: Search for a function named badgeSvgGet or dataGet. They will have two parameters named options?. 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.

@auto-labeler
Copy link

auto-labeler bot commented Apr 23, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@wing328
Copy link
Member

wing328 commented Mar 10, 2021

I think this should be fixed recently. Please pull the latest master to give it a try

@wing328 wing328 closed this as completed Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants