-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated client with typescript-fetch generator is very different from swagger-codegen-2.2.3 #347
Comments
@megaboich I agree this change caused issues for quite some people, see swagger-api/swagger-codegen#7595 Maybe @jawa-the-hutt would like to port swagger-api/swagger-codegen#7930 to OpenAPI Generator? Having an option would allow to choose and therefore to fit both approaches. |
I've created a fork of the typescript-fetch generator over at https://github.com/Place1/swagger-codegen-typescript-browser I'd be very interested in using it as the foundation for a rework of typescript-fetch over here. It follows the params object as api method argument and fixes a bunch of other issues present in the generator related to form data and model naming conversions (camelCase), additionally, it supports middleware. |
Ah that's a very good idea. I'll look into it. I didn't have any time to start working on it yet (due to another project running sideways) but my schedule should become more relaxed now. |
@TiFu if the parameters of the api methods are to be combined into a single object (maybe as an option), swagger-api/swagger-codegen#8435 of @sschoeb could also be considered. maybe @sschoeb would want to help? |
Where can I find documentation on the template variables that swagger-codegen produces in the latest version? We are using a custom template based on TypeScript-Fetch (in order to fix/modify some things about it) and similar to the OP after trying to upgrade I found that the differences are quite substantial... |
I'm not sure if there's documentation for it, but you can print the available template variables. See |
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
After
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:
projectId
and 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?
The text was updated successfully, but these errors were encountered: