Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #14649
Closed
Open
Issue created Feb 08, 2023 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[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
  1. Generate a typescript-axios client using the config above (or any OpenAPI declaration with an "options" parameter)
  2. 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

Assignee
Assign to
Time tracking