swagger-api / swagger-api/swagger-codegen
[JAVA][library: vertx] generated client does not maintain backwards compatibility with older versions of vertx
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
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);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Java/libraries/vertx/ApiClient.mustache and inspect the buildResponseHandler method and its response-decoding path. Check how generated clients handle Vert.x versions below 3.5, then verify that generated Vert.x clients retain compatibility with those versions and that decoding failures remain represented by the expected exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100