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
  • #7880
Closed
Open
Issue created Nov 04, 2020 by Administrator@rootContributor0 of 1 checklist item completed0/1 checklist item

[BUG] Cannot compile generated code with `typescript-axios` with parameter named `configuration`

Created by: ndrsklng

Bug Report Checklist

  • [ x] Have you provided a full/minimal spec to reproduce the issue?
  • [ x] Have you validated the input using an OpenAPI validator (example)?
  • [ x] Have you tested with the latest master to confirm the issue still exists?
  • [ x] Have you searched for related issues/PRs?
  • [ x] What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The code will not compile when I generate code with the typescript-axios generator and my OpenApi file contains a parameter named configuration. The parameter name will conflict with the configuration variable in the API classes.

openapi-generator version

4.3.1

OpenAPI declaration file content or url

Part of the OpenAPI file which contains an endpoint with a parameter named configuration.

  /sites/{siteid}/{code}:
    post:
      parameters:
      - in: path
        name: siteid
        required: true
        type: string
      - in: path
        name: code
        required: true
        type: string
      - in: body
        name: configuration
        required: true
        schema:
          $ref: '#/definitions/ConfigurationData'
Generation Details

java -jar openapi-generator-clijar generate --generator-name typescript-axios --input-spec openapi.yaml

Steps to reproduce

Generate code with the command above will work without any errors, but running tcs on the generated code will fail.

Related issues/PRs

A similar issue for the typescrip-fetch generator: https://github.com/OpenAPITools/openapi-generator/issues/2564

Suggest a fix

Add configuration to list of reserved words in AbstractTypeScriptClientCodegen. Alternatively, add it to the list of reserved words in the TypeScriptAxiosClientCodegen.

Assignee
Assign to
Time tracking