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
  • #347
Closed
Open
Issue created Jun 19, 2018 by Administrator@rootContributor

Generated client with typescript-fetch generator is very different from swagger-codegen-2.2.3

Created by: megaboich

The problem: When using latest openapi-generator there is a lot of differences in generated client codebase.

We have quite a big code base generated automatically using swagger-codegen-2.2.3. There are some 35 of different REST controllers and we have build automation script that generates typescript-fetch API clients for them during the build process and in general it works very well and everyone is happy.

But I think in version 3 of swagger codegen there were introduced lots of changes. The most annoying change is switching from object-structured parameters to plain parameters. Compare this code which invokes generated api: Before

    await this.api.getWorkspacePermissions({
        authorization: this.apiHelper.authToken,
        workspaceId: workspaceId
    })

After

    await this.api.getWorkspacePermissions(this.apiHelper.authToken, workspaceId)

I do not like that names of parameters are not presented now. In some cases we have lots of string parameters and here I see several disadvantages in this approach:

  1. When I do not see the names then it is not readable anymore.
  2. Error could be easily added when I put them in wrong order.
  3. Also if someone at backend decide to change parameter name and order (like remove something called projectId and add different required parameter called parentObjectId) then new generated client will still be compatible because there is just a bunch of string parameters in API call without information about the name.

Any ideas why this change was introduced? Probably I just do not see the benefits from it?

Assignee
Assign to
Time tracking