-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
codegen, oas-3-compat: Treatment of parameter style "deepObject" is shady #469
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
Comments
Right now the In my opinion:
|
Yeah, that makes sense. By the way, is there any issue that aggregates incompatibilities with OAS-3? If not I would argue that this is really needed. In one of the first sentences of |
Feel free to open an aggregation issue for all "Feature: OAS 3.0 spec support" issues. I will try to tag all what you find and I welcome any effort that helps with issue-triage. I think that we never tried to hide that some corner cases of OpenAPI v2 or v3 are not supported. For v3, it might be more than for v2 because the support of v3 is new. We have even one line that mention it in the roadmap. This project is issue-driven and I appreciate all the issues that you are filling. It helps to make the project better. The next step is to propose pull-requests to fix those. |
Actually if the label is well-maintained, that should be fine. I just did not believe that actually these issues are all known counterexamples to OAS 3 conformance. Just in the last two days I found a number of bugs. But that's not to talk badly, just to help point the finger at where more work would make sense. |
We made an implementation to support deepObject for .NET Core and Java native client in Reinhard-PTV@4fbd210 . Can we submit these changes as a pull request? |
Description
It seems to me that your codegen layer does not treat the deepObject style for parameters. For example it is missing in the method
DefaultCodegen#getCollectionFormat
where it should probably be treated in one way or another.The result for the YAML below is that I get a client implementation that does not seem to handle the deepObject case in
ApiClient
:The resulting query parameter looks like:
where I would expect no parameters to be present (all values inside the filter object are
null
). Generally I expect it to look like:openapi-generator version
020883f (master from 2018-07-04)
OpenAPI declaration file content or url
Command line used for generation
java -jar openapi-generator-cli.jar generate -l java -i api.yml -o jclient
Steps to reproduce
Generate client.
Suggest a fix/enhancement
You should treat deepObject style parameters as specified in OAS 3.0.1, there even is an example: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#style-examples
The text was updated successfully, but these errors were encountered: