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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public class ApiClient {

updateParamsForAuth(authNames, queryParams, headerParams);

if (accepts != null) {
if (accepts != null && accepts.length > 0) {
headerParams.add(HttpHeaders.ACCEPT, selectHeaderAccept(accepts));
}

Expand Down Expand Up @@ -576,7 +576,7 @@ public class ApiClient {
return;
} else {
try {
resultContent = Json.mapper.readValue(httpResponse.bodyAsString(), returnType);
resultContent = this.objectMapper.readValue(httpResponse.bodyAsString(), returnType);
result = Future.succeededFuture(resultContent);
} catch (Exception e) {
result = ApiException.fail(new DecodeException("Failed to decode:" + e.getMessage(), e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public <T> void invokeAPI(String path, String method, List<Pair> queryParams, Ob

updateParamsForAuth(authNames, queryParams, headerParams);

if (accepts != null) {
if (accepts != null && accepts.length > 0) {
headerParams.add(HttpHeaders.ACCEPT, selectHeaderAccept(accepts));
}

Expand Down Expand Up @@ -572,7 +572,7 @@ protected <T> Handler<AsyncResult<HttpResponse<Buffer>>> buildResponseHandler(Ty
return;
} else {
try {
resultContent = Json.mapper.readValue(httpResponse.bodyAsString(), returnType);
resultContent = this.objectMapper.readValue(httpResponse.bodyAsString(), returnType);
result = Future.succeededFuture(resultContent);
} catch (Exception e) {
result = ApiException.fail(new DecodeException("Failed to decode:" + e.getMessage(), e));
Expand Down