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

Two tiny fixes for Java Vertx client #3683

Merged
merged 2 commits into from
Aug 25, 2019

Conversation

FlorianBruckner
Copy link
Contributor

@FlorianBruckner FlorianBruckner commented Aug 19, 2019

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, ./bin/openapi3/{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\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

CC: @bbdouglas, @sreeshas, @jfiala, @lukoyanov, @cbornet, @jeff9finger, @karismann @Zomzog

Description of the PR

1.) ApiClient already defines and configures an objectMapper to not fail on unknown properties, but it is not used when parsing the response. The fix uses the pre-configured object mapper instead of the vertx default one

2.) When an operation has no response (or just ones without content), the accept array passed to ApiClient is emtpy. This makes the null check in ApiClient useless, as it still tries to set a null Accept header, which is refused with an NPE. Amend the check with .length > 0 to catch this case.

This fix is for 4.1, which I believe is the version currently living on master, so filing the PR against this branch.

1.) ApiClient already defines and configures an objectMapper to not fail on unknown properties, but it is not used when parsing the response. The fix uses the pre-configured object mapper instead of the vertx default one

2.) When an operation has no response (or just ones without content), the accept array passed to ApiClient is emtpy. This makes the null check in ApiClient useless, as it still tries to set a null Accept header, which is refused with an NPE. Amend the check with .length > 0 to catch this case.
@jmini
Copy link
Member

jmini commented Aug 20, 2019

In my opinion the AppVeyor build failure is not related to this change

@wing328 wing328 added this to the 4.1.1 milestone Aug 25, 2019
@wing328 wing328 changed the title two tiny fixes for java vertx Two tiny fixes for Java Vertx client Aug 25, 2019
@wing328 wing328 merged commit 16ac05d into OpenAPITools:master Aug 25, 2019
jimschubert added a commit that referenced this pull request Aug 25, 2019
* master: (45 commits)
  update python samples
  Two tiny fixes for Java Vertx client (#3683)
  Exclude "test" from packages so that it is not installed as top-level package when "pip installing" the generated sdk (#3731)
  [java-client] add unit test for JDK 11 HttpClient (#3735)
  [R] feat(r): handling error response for 3xx cases (#3571)
  [Dart] Avoid redundant null checking in fromJson (#3632)
  [core] Set isMultipart=true for multipart operations, fix possible NPE (#3750)
  reenable kotlin client tests in shippable ci (#3751)
  Fix null assignation to header/query param map (#3749)
  Mockito 3.0.0 (#3732)
  Update to swagger-parser to 2.0.14-OpenAPITools.org-1 (#3737)
  Add a link to a Qiita blog post (#3747)
  update csharp samples
  Simple spelling error in dotnet core comments (#3746)
  better support for multipart (#3736)
  [typescript-fetch] fix #1998: prefix req ifaces. (#3740)
  cpp-qt5-client: add valgrind memory test (#3663)
  [typescript-angular] Encode objects for multipart/form-data with json - fixes #2733 (#3738)
  [BUG] Https protocol schema is not handled correctly in java 11 native code #3729 (#3730)
  comment out kotlin client tests
  ...
@wing328
Copy link
Member

wing328 commented Aug 26, 2019

@FlorianBruckner thanks for the PR, which has been included in the v4.1.1 release: https://twitter.com/oas_generator/status/1165944867391860737

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