Skip to content
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] [Java] Client resttemplate and webclient. Form Params are badly added when they are lists #4461

Merged
merged 7 commits into from
Nov 17, 2019

Conversation

jorgerod
Copy link
Contributor

@jorgerod jorgerod commented Nov 12, 2019

…when they are lists

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language. @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10)

Description of the PR

Addresses issue #4383 for java resttemplate and java webclient

@jorgerod
Copy link
Contributor Author

Hi

Elixir tests are failing but I have not changed anything related to elixir.
Can you help me?

Thank you

@lwlee2608
Copy link
Contributor

Not sure about the elixer failure. But looks like you have not updated the sample files. You can refer to this link for more information

@wing328
Copy link
Member

wing328 commented Nov 12, 2019

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

@wing328
Copy link
Member

wing328 commented Nov 12, 2019

Usually, the elixir test failure is due to failure in installing some elixir binaries/dependencies and a job restart should fix it.

We can restart the failed job before merging the PR

Copy link
Contributor

@lwlee2608 lwlee2608 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why some of the MultiValueMap type parameters <K, V> are being removed?

@jorgerod
Copy link
Contributor Author

Any reason why some of the MultiValueMap type parameters <K, V> are being removed?

Resttemplate use spring-web 4.x.x. In this version. MultiValueMap hasn´t method addAll. (I think you should upgrade the version)

So, the best option to insert a list, for example strings, is with the put method but if MultivalueMap <String, Object>, does not compile when doing .put ("key", List <String>)

@lwlee2608
Copy link
Contributor

I see. I guess that's fine...
Another option is to copy the list to a new List<Object>

            List<Object> enumFormObjectArray = new ArrayList<Object>(enumFormStringArray);
            formParams.put("enum_form_string_array", enumFormObjectArray);

This way, we can keep MultiValueMap's type parameter, but it is obviously less efficient.
3rd option is to upgrade to spring 5.x.x
I'll let @wing328 decides :)

@wing328
Copy link
Member

wing328 commented Nov 17, 2019

3rd option is to upgrade to spring 5.x.x

We can do that later in another PR

@wing328 wing328 merged commit 60958b7 into OpenAPITools:master Nov 17, 2019
@wing328 wing328 added this to the 4.2.2 milestone Nov 17, 2019
jimschubert added a commit to jimschubert/openapi-generator that referenced this pull request Nov 17, 2019
…ulti-level-model-hierarchy

* origin/master:
  minor fix to CI failure
  feat(dart-dio): correctly handle Map<String, Object>, List<Object> using JsonObject (OpenAPITools#4401)
  [OCAML] Fixes cloud.drone.io ocaml-test (OpenAPITools#4501)
  [elm] Add support for oneOf (OpenAPITools#4434)
  [BUG] [Java] Client resttemplate and webclient. Form Params are badly added when they are lists  (OpenAPITools#4461)
  fix: prevent ClassCastException when handling options of (issue OpenAPITools#4468) (OpenAPITools#4495)
  Fixes Python client Configuration class so each instance uses its own dicts (OpenAPITools#4485)
@wing328
Copy link
Member

wing328 commented Dec 2, 2019

@jorgerod thanks for the PR, which has been included in the v4.2.2 release: https://twitter.com/oas_generator/status/1201432648544972800

@jorgerod jorgerod deleted the gh-4383 branch December 2, 2019 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants