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
  • #14985
Closed
Open
Issue created Mar 17, 2023 by Royi Freifeld@royi-frontegg

[BUG][TYPESCRIPT-AXIOS] Typescript-axios generator creates the wrong return type and encoding

I used this official OPA openapi to generate an a client for OPA using typescript-axios

I ran the following to generate the code

npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g typescript-axios -o gen -penumUnknownDefaultCase=true -pnpmName=my-npm-package -pnpmVersion=0.0.1 -pnullSafeAdditionalProps=true -pwithNodeImports=true -pwithSeparateModelsAndApi=true -pmodelPackage=models -papiPackage=api

I also tried with latest cli docker to make sure that it isn't something related to the npx version

  1. One weird thing is that the Data Api getDocumentWithPath function was generated with DeletePolicyModule200Response which is definitely not the expected case.
  2. The path param in getDocumentWithPath is getting encoded so I can't reach nested paths (e.g /firstPath/secondPath) since it is trying to get to firstPath%2FsecondPath that doesn't exist, which makes a lot of sense. Maybe there's a possibility to utilize the the url field in the axios config argument that is passed as the last param of the function
Assignee
Assign to
Time tracking