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][typescript-nestjs] Destructuring requestParameters break generated service #20156

Open
GregoryMerlet opened this issue Nov 21, 2024 · 0 comments · May be fixed by #20157
Open

[BUG][typescript-nestjs] Destructuring requestParameters break generated service #20156

GregoryMerlet opened this issue Nov 21, 2024 · 0 comments · May be fixed by #20157

Comments

@GregoryMerlet
Copy link
Contributor

Description

When using useSingleRequestParameter the parameters are destructured in services methods like this:

const {
  param1,
  param2,
  ...
} = requestParameters;

As parameters name are not something we can be certain of, it's not safe to use them like that.
In our case we have a parameter named from which later breaks the use of from(...) initialy imported from rxjs.

openapi-generator version

7.10.0

Generation Details

typescript-nestjs generator with useSingleRequestParameter=true

Steps to reproduce

Generate with an input file where a request parameter is named from

Suggest a fix

Stop destructuring requestParameters and access its properties when needed instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant