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
[BUG] [typescript-axios] Interface parameters don't follow paramNaming #10643
Comments
I am also experiencing this issue, while it worked fine in the previous version. Please let me know if there is any additional test case or debugging information I can provide. |
@rhuanbarreto @nickjs |
Hi Yuya, thanks for the follow up! Upon digging further into this I did find that PR that disabled the option (sorry I didn't update my original comment!), however I believe there may be further use cases to consider. I totally agree with the spirit behind the change: the generated axios requests/responses should match what the server is going to send or expect! If the server won't send camelCased properties, we shouldn't even allow camelCased properties to be an option. However. Axios is, for better or worse, highly configurable. For example, I currently find myself working in a codebase where axios is configured to transform all incoming property names from snake_case to camelCase, which breaks with these latest typings. And that expectation is, of course, already used across hundreds of call-sites, so changing them all would be difficult :) To be clear though: I am not trying to make an argument purely for backwards-compatibility -- more just that since this is an axios-specific adapter, if there's an option or transform that axios supports, we should allow generating typings to match it. Probably not go out of our way to do so if something is difficult, but at least make it possible. @aiven-hh @macjohnny Sorry to tag you in here, but I would love to get your feedback. Would you be open to me submitting a PR that adds just |
It was probably wrong to disable it. I only now noticed reading that point through that it is documented as "Only change it if you provide your own run-time code for (de-)serialization of models". I probably assumed it transformed the properties in every case which was the problem overall (and was fixed with other changes and I assume works with the "original" setting). |
@nickjs your contribution would be welcome |
Hello! Do we have any updates on this issue? In this issue parameter |
#10643 (comment) However, in my case, I need the behavior for my running product in development. Then, I addressed it with follows. It might make your project complex and bit hard to maintain.
The process is totally ignore your option which might change model property name if there is. Because it converts the property name by compulsion. |
I use axios to convert snake_case responses by Rails to camelCase. |
Any update on this? This is insane that camelCase, which is such a trivial and must-to-have feature has been disabled! |
Bug Report Checklist
Description
If an API definition has a schema with another parameter format than camelCase, the parameter format in the model/interface should also follow the
paramNaming
config and be camelCase.openapi-generator version
5.3.0-SNAPSHOT
OpenAPI declaration file content or url
Generation Details
config:
Steps to reproduce
Generate the API with this config.
Then model interfaces will be generated without translating parameters to camelCase.
This behaviour is done in the javascript generator correctly.
The text was updated successfully, but these errors were encountered: