[BUG][Typescript-Axios] typescript-axios generator outputs invalid code if a parameter is named "options"
Created by: illandril
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When generating a typescript-axios client for an API with a parameter named "options", the generated code has a duplicate identifier syntax error.
openapi-generator version
6.3.0
OpenAPI declaration file content or url
https://gist.github.com/illandril/912a03f77d602a22cd0ac536d086dc50
Generation Details
npx @openapitools/openapi-generator-cli generate -i swagger.json -g typescript-axios -o tmp
Steps to reproduce
- Generate a typescript-axios client using the config above (or any OpenAPI declaration with an "options" parameter)
- Validate the output for syntax errors
Example line with a syntax error:
v1SamplePost: async (options?: object, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
Related issues/PRs
None that I could find
Suggest a fix
I suspect this will be as simple as adding reservedWords.add("options");
to the constructor of TypeScriptAxiosClientCodegen.java