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
  • #9036
Closed
Open
Issue created Mar 22, 2021 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[BUG][typescript-axios] Broken client

Created by: vmstarchenko

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?
Description

openapi-generator create broken client for attached schema. Errors:

  • Types error:
  > 75 |         apiProblemCreate: async (tags: Array<ProblemTagRequest>, options: any = {}): Promise<RequestArgs> => {
       |                                              ^ // ProblemTagRequest does not exist
    76 |             // verify required parameter 'tags' is not null or undefined
    77 |             assertParamExists('apiProblemCreate', 'tags', tags)
    78 |             const localVarPath = `/api/problem/`;
  • DataForm usage error
92 |  localVarFormParams.append(tags.join(COLLECTION_FORMATS.csv));
                               ^ // here should be append('tags', tags...
  • wrong array usage
92 |    localVarFormParams.append(tags.join(COLLECTION_FORMATS.csv));
                                         ^ // join returns [object Object],[object Object],
openapi-generator version

5.0.1 latest dev version

OpenAPI declaration schema

https://gist.github.com/vmstarchenko/9671d45499a66d73b6746e69168c6cc5

Generation Details
java -jar ./openapi-generator-5.0.1/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i ./api-spec.yaml -g typescript-axios --additional-properties=useSingleRequestParameter=true -o ./client/typescript-axios

Generated client: https://gist.github.com/vmstarchenko/5128a715559fcb065649b37b316f3be9

Steps to reproduce

Generate typescript-axios client with useSingleRequestParameter additional property and attached schema

Related issues/PRs
Suggest a fix
Assignee
Assign to
Time tracking