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

[Java][Client][RestTemplate] Do not create new Object for empty body #605

Merged
merged 2 commits into from
Jul 20, 2018

Conversation

rubms
Copy link
Contributor

@rubms rubms commented Jul 19, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.1.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

Fixed issue #513, introduced in pull request #98. While the change introduced in #98 is appropriate for many java client libraries, that directly serialize via Jackson or Gson, it breaks the RestTemplate generation (as RestTemplate relies on message converters and these are not able to serialize java.lang.Objects.

This PR rolls #98 back exclusively for the RestTemplate client library.

cc @jmini @bmordue @macjohnny @bbdouglas @JFCote @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger

…form HTTP requests without a body and an empty Object is used as body instead. In these cases an exception is thrown indicating that it is not possible to find a message converter for java.lang.Object and application/json.
@jmini
Copy link
Member

jmini commented Jul 19, 2018

I think this PR is OK.
Can you also update the resttemplate-withXml sample?

Copy link
Member

@jmini jmini left a comment

Choose a reason for hiding this comment

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

Please update the samples

@rubms
Copy link
Contributor Author

rubms commented Jul 20, 2018

Thanks @jmini, I've just updated the resttemplate-withXml samples.

@jmini jmini merged commit 0da5508 into OpenAPITools:master Jul 20, 2018
@jmini
Copy link
Member

jmini commented Jul 20, 2018

Thank you a lot for this PR

@jmini jmini added this to the 3.1.2 milestone Jul 20, 2018
@jmini jmini changed the title [Java][Client][RestTemplate] Fixed issue #513 [Java][Client][RestTemplate] Do not create new Object for empty body Jul 20, 2018
@jeff9finger
Copy link
Contributor

LGTM 👍

@rubms rubms deleted the #513 branch July 23, 2018 07:51
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
…penAPITools#605)

OpenAPITools#513 Fixed error that causes exception when trying to perform HTTP requests without a body and an empty Object is used as body instead. In these cases an exception is thrown indicating that it is not possible to find a message converter for java.lang.Object and application/json.
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