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:
- When I do not see the names then it is not readable anymore.
- Error could be easily added when I put them in wrong order.
- Also if someone at backend decide to change parameter name and order (like remove something called
projectIdand add different required parameter calledparentObjectId) 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?