Skip to content

#23560 Correct imports for RxJava2 and RxJava3. Add support for Vert.x 5. #23563

Open
sjw2547 wants to merge 9 commits intoOpenAPITools:masterfrom
sjw2547:master
Open

#23560 Correct imports for RxJava2 and RxJava3. Add support for Vert.x 5. #23563
sjw2547 wants to merge 9 commits intoOpenAPITools:masterfrom
sjw2547:master

Conversation

@sjw2547
Copy link
Copy Markdown

@sjw2547 sjw2547 commented Apr 15, 2026

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 useVertx5 option, 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

    • Added useVertx5 (--additional-properties useVertx5=true) to generate Vert.x 5 syntax in ApiClient (Future-based sendBody and file I/O); updated docs (docs/generators/java.md, docs/generators/java-microprofile.md), added bin/configs/java-vertx5.yaml, new sample at samples/client/petstore/java/vertx5, and included it in .github/workflows/samples-java-client-jdk11.yaml.
    • Gradle template: when useVertx5=true, set Vert.x 5.0.11 and Java 11; choose io.vertx:vertx-rx-java2 or io.vertx:vertx-rx-java3 based on useRxJava2/useRxJava3.
  • Bug Fixes

    • Corrected RxJava imports in rxApiImpl.mustache: use io.reactivex.Single/io.reactivex.rxjava3.core.Single and io.vertx.reactivex.SingleHelper/io.vertx.rxjava3.SingleHelper; replaced Single.create with SingleHelper.toSingle for RxJava2/3.
    • Maven pom.mustache: fixed Rx artifact selection to pick io.vertx:vertx-rx-java3, io.vertx:vertx-rx-java2, or io.vertx:vertx-rx-java as appropriate; set Vert.x 5.0.11 and compiler source/target to 11 when useVertx5=true.

Written for commit 8fb8376. Summary will update on new commits.

…rt for Vert.x 5 while keeping backward compatibility for earlier versions. Add new parameter for useVertx5.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@sjw2547 sjw2547 changed the title Correct imports for RxJava2 and RxJava3. Add support for Vert.x 5. (#23560) #23560 Correct imports for RxJava2 and RxJava3. Add support for Vert.x 5. Apr 15, 2026
@wing328
Copy link
Copy Markdown
Member

wing328 commented Apr 16, 2026

please follow step 3 to update samples and docs.

@sjw2547
Copy link
Copy Markdown
Author

sjw2547 commented Apr 16, 2026

please follow step 3 to update samples and docs.

Done

Comment thread bin/configs/java-vertx5.yaml
…e correct libraries and add path to samples-java-client-jdk11.yaml
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread samples/client/petstore/java/vertx5/build.gradle
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sjw2547 sjw2547 closed this Apr 21, 2026
@sjw2547 sjw2547 reopened this Apr 21, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache Outdated
Comment thread samples/client/petstore/java/vertx5/pom.xml
@sjw2547 sjw2547 requested a review from wing328 April 21, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants