[JAVA][library: vertx] generated client does not maintain backwards compatibility with older versions of vertx
Created by: ccozzolino
Description
The buildResponseHandler
method defined in Java/libraries/vertx/ApiClient.mustache
makes a call to Json.decodeValue(String, Class<T>)
which is not supported in older versions (< 3.5) of Vert.x. The call should be adjusted to handle all versions.
Swagger-codegen version
All versions with vertx async & rx support
Suggest a fix/enhancement
Change the call from:
resultContent = Json.decodeValue(httpResponse.body(), returnType);
to:
try {
resultContent = Json.mapper.readValue(httpResponse.bodyAsString(), returnType);
} catch (Exception e) {
throw new DecodeException("Failed to decode:" + e.getMessage(), e);
}