#23560 Correct imports for RxJava2 and RxJava3. Add support for Vert.x 5. #23563
Open
sjw2547 wants to merge 9 commits intoOpenAPITools:masterfrom
Open
#23560 Correct imports for RxJava2 and RxJava3. Add support for Vert.x 5. #23563sjw2547 wants to merge 9 commits intoOpenAPITools:masterfrom
sjw2547 wants to merge 9 commits intoOpenAPITools:masterfrom
Conversation
…rt for Vert.x 5 while keeping backward compatibility for earlier versions. Add new parameter for useVertx5.
6 tasks
Member
|
please follow step 3 to update samples and docs. |
Author
Done |
wing328
reviewed
Apr 20, 2026
…e correct libraries and add path to samples-java-client-jdk11.yaml
Contributor
There was a problem hiding this comment.
2 issues found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="samples/client/petstore/java/vertx5/build.gradle">
<violation number="1" location="samples/client/petstore/java/vertx5/build.gradle:35">
P1: Vert.x was upgraded to 5.x, but the Gradle Java compatibility is still pinned to Java 8, creating a real toolchain/runtime compatibility mismatch.</violation>
</file>
<file name="modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache:35">
P1: `vertx_version` template can concatenate two versions (`5.0.11` + `4.0.0`) when both flags are true, producing an invalid dependency version.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache:35">
P1: `vertx_version` template logic has a missing branch: when both `useVertx5` and `supportVertxFuture` are true, it renders an empty version and breaks generated Gradle dependencies.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="samples/client/petstore/java/vertx5/pom.xml">
<violation number="1" location="samples/client/petstore/java/vertx5/pom.xml:272">
P2: Upgrading to Vert.x 5 while keeping Java 8 compiler target creates an inconsistent and potentially incompatible Java baseline.</violation>
</file>
<file name="modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache:234">
P1: POM Rx artifact selection omits the supported `useRxJava2` case, causing wrong dependency (`vertx-rx-java`) for RxJava2 generation.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The mustache template for rxApiImpl, when working with Rx Java 2 and 3, imports rx.Single. This class is relocated with Rx Java 2 and 3, import has been corrected for those versions, along with using SingleHelper instead of Single.create()
For Vert.x 5 the generated ApiClient does not compile because the deprecated methods in Vert.x 4 that take a handler as a final parameter have been removed, returning a furutre instead. Added a new command line option called useVertx5 to call the replacement methods instead.
Summary by cubic
Fixes incorrect RxJava imports in generated Vert.x Rx clients and adds Vert.x 5 support via a new
useVertx5option, so Java clients compile against Vert.x 5 while keeping Vert.x 4 compatibility. Adds a Vert.x 5 sample and updates templates/CI to use the right Vert.x/Rx artifacts and Java 11 where required.New Features
useVertx5(--additional-properties useVertx5=true) to generate Vert.x 5 syntax inApiClient(Future-basedsendBodyand file I/O); updated docs (docs/generators/java.md,docs/generators/java-microprofile.md), addedbin/configs/java-vertx5.yaml, new sample atsamples/client/petstore/java/vertx5, and included it in.github/workflows/samples-java-client-jdk11.yaml.useVertx5=true, set Vert.x5.0.11and Java 11; chooseio.vertx:vertx-rx-java2orio.vertx:vertx-rx-java3based onuseRxJava2/useRxJava3.Bug Fixes
rxApiImpl.mustache: useio.reactivex.Single/io.reactivex.rxjava3.core.Singleandio.vertx.reactivex.SingleHelper/io.vertx.rxjava3.SingleHelper; replacedSingle.createwithSingleHelper.toSinglefor RxJava2/3.pom.mustache: fixed Rx artifact selection to pickio.vertx:vertx-rx-java3,io.vertx:vertx-rx-java2, orio.vertx:vertx-rx-javaas appropriate; set Vert.x5.0.11and compilersource/targetto 11 whenuseVertx5=true.Written for commit 8fb8376. Summary will update on new commits.