[Java] [vertx] Make supportVertxFuture compatible with vertx 5#23660
[Java] [vertx] Make supportVertxFuture compatible with vertx 5#23660RickyRister wants to merge 4 commits intoOpenAPITools:masterfrom
Conversation
There was a problem hiding this comment.
7 issues found across 231 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed. cubic prioritises the most important files to review.
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-supportVertxFuture/docs/FakeClassnameTags123Api.md">
<violation number="1" location="samples/client/petstore/java/vertx5-supportVertxFuture/docs/FakeClassnameTags123Api.md:13">
P2: Vert.x future-mode docs still present a synchronous `Client` return and `ApiException` try/catch, but the generated API returns `Future<Client>`; the sample code is incorrect and will not compile as written.</violation>
</file>
<file name="samples/client/petstore/java/vertx5-supportVertxFuture/docs/EnumArrays.md">
<violation number="1" location="samples/client/petstore/java/vertx5-supportVertxFuture/docs/EnumArrays.md:11">
P3: Broken internal anchor for the `arrayEnum` enum section; the fragment will not match the generated heading id.</violation>
</file>
<file name="samples/client/petstore/java/vertx5-supportVertxFuture/docs/MapTest.md">
<violation number="1" location="samples/client/petstore/java/vertx5-supportVertxFuture/docs/MapTest.md:11">
P3: Broken intra-document enum link: the fragment does not match the generated heading anchor.</violation>
</file>
<file name="samples/client/petstore/java/vertx5-supportVertxFuture/docs/DefaultApi.md">
<violation number="1" location="samples/client/petstore/java/vertx5-supportVertxFuture/docs/DefaultApi.md:13">
P2: Docs for the Vert.x Future sample still show a synchronous `fooGet()`/`ApiException` example, but the actual API returns `Future<FooGetDefaultResponse>`, so the snippet is inaccurate and misleading.</violation>
</file>
<file name="samples/client/petstore/java/vertx5-supportVertxFuture/.travis.yml">
<violation number="1" location="samples/client/petstore/java/vertx5-supportVertxFuture/.travis.yml:9">
P2: The Travis matrix includes JDK 8/9/10 even though this Vert.x 5 sample is Java 11-only, so those CI jobs will fail deterministically.</violation>
</file>
<file name="samples/client/petstore/java/vertx5-supportVertxFuture/docs/AnotherFakeApi.md">
<violation number="1" location="samples/client/petstore/java/vertx5-supportVertxFuture/docs/AnotherFakeApi.md:37">
P2: Docs example uses a synchronous `Client`/`ApiException` pattern for a Future-returning Vert.x 5 API.</violation>
</file>
<file name="samples/client/petstore/java/vertx5-supportVertxFuture/git_push.sh">
<violation number="1" location="samples/client/petstore/java/vertx5-supportVertxFuture/git_push.sh:48">
P1: Embedding `GIT_TOKEN` in the remote URL stores the secret in Git config and can expose it through remote listings/logs.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." | ||
| git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git | ||
| else | ||
| git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git |
There was a problem hiding this comment.
P1: Embedding GIT_TOKEN in the remote URL stores the secret in Git config and can expose it through remote listings/logs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/vertx5-supportVertxFuture/git_push.sh, line 48:
<comment>Embedding `GIT_TOKEN` in the remote URL stores the secret in Git config and can expose it through remote listings/logs.</comment>
<file context>
@@ -0,0 +1,57 @@
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
</file context>
| @@ -0,0 +1,82 @@ | |||
| # FakeClassnameTags123Api | |||
There was a problem hiding this comment.
P2: Vert.x future-mode docs still present a synchronous Client return and ApiException try/catch, but the generated API returns Future<Client>; the sample code is incorrect and will not compile as written.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/vertx5-supportVertxFuture/docs/FakeClassnameTags123Api.md, line 13:
<comment>Vert.x future-mode docs still present a synchronous `Client` return and `ApiException` try/catch, but the generated API returns `Future<Client>`; the sample code is incorrect and will not compile as written.</comment>
<file context>
@@ -0,0 +1,82 @@
+
+## testClassname
+
+> Client testClassname(client)
+
+To test class name in snake case
</file context>
|
|
||
| ## fooGet | ||
|
|
||
| > FooGetDefaultResponse fooGet() |
There was a problem hiding this comment.
P2: Docs for the Vert.x Future sample still show a synchronous fooGet()/ApiException example, but the actual API returns Future<FooGetDefaultResponse>, so the snippet is inaccurate and misleading.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/vertx5-supportVertxFuture/docs/DefaultApi.md, line 13:
<comment>Docs for the Vert.x Future sample still show a synchronous `fooGet()`/`ApiException` example, but the actual API returns `Future<FooGetDefaultResponse>`, so the snippet is inaccurate and misleading.</comment>
<file context>
@@ -0,0 +1,69 @@
+
+## fooGet
+
+> FooGetDefaultResponse fooGet()
+
+
</file context>
| @@ -0,0 +1,22 @@ | |||
| # | |||
There was a problem hiding this comment.
P2: The Travis matrix includes JDK 8/9/10 even though this Vert.x 5 sample is Java 11-only, so those CI jobs will fail deterministically.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/vertx5-supportVertxFuture/.travis.yml, line 9:
<comment>The Travis matrix includes JDK 8/9/10 even though this Vert.x 5 sample is Java 11-only, so those CI jobs will fail deterministically.</comment>
<file context>
@@ -0,0 +1,22 @@
+language: java
+jdk:
+ - openjdk12
+ - openjdk11
+ - openjdk10
+ - openjdk9
</file context>
| # | |
| - openjdk11 |
| AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); | ||
| Client client = new Client(); // Client | client model | ||
| try { | ||
| Client result = apiInstance.call123testSpecialTags(client); |
There was a problem hiding this comment.
P2: Docs example uses a synchronous Client/ApiException pattern for a Future-returning Vert.x 5 API.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/vertx5-supportVertxFuture/docs/AnotherFakeApi.md, line 37:
<comment>Docs example uses a synchronous `Client`/`ApiException` pattern for a Future-returning Vert.x 5 API.</comment>
<file context>
@@ -0,0 +1,75 @@
+ AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
+ Client client = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.call123testSpecialTags(client);
+ System.out.println(result);
+ } catch (ApiException e) {
</file context>
| | Name | Type | Description | Notes | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| |**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | | ||
| |**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | |
There was a problem hiding this comment.
P3: Broken internal anchor for the arrayEnum enum section; the fragment will not match the generated heading id.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/vertx5-supportVertxFuture/docs/EnumArrays.md, line 11:
<comment>Broken internal anchor for the `arrayEnum` enum section; the fragment will not match the generated heading id.</comment>
<file context>
@@ -0,0 +1,32 @@
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] |
+|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] |
+
+
</file context>
| |**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | | |
| |**arrayEnum** | [**List<ArrayEnumEnum>**](#enum-listarrayenumenum) | | [optional] | |
| | Name | Type | Description | Notes | | ||
| |------------ | ------------- | ------------- | -------------| | ||
| |**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | | ||
| |**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | |
There was a problem hiding this comment.
P3: Broken intra-document enum link: the fragment does not match the generated heading anchor.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/java/vertx5-supportVertxFuture/docs/MapTest.md, line 11:
<comment>Broken intra-document enum link: the fragment does not match the generated heading anchor.</comment>
<file context>
@@ -0,0 +1,25 @@
+| Name | Type | Description | Notes |
+|------------ | ------------- | ------------- | -------------|
+|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] |
+|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] |
+|**directMap** | **Map<String, Boolean>** | | [optional] |
+|**indirectMap** | **Map<String, Boolean>** | | [optional] |
</file context>
| |**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | | |
| |**mapOfEnumString** | [**Map<String, InnerEnum>**](#enum-mapstring-innerenum) | | [optional] | |
Closes #23659
In vertx 5,
Promiseno longer extendsHandler<AsyncResult>, which means we can't directly pass in a promise into an arg that accepts a handler. However,promise::handlestill works, in both versions of vertx.Also added a new sample
java-vertx5-supportVertxFutureto the samples.PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) @martin-mfg (2023/08)
Summary by cubic
Make
supportVertxFuturecompatible with Vert.x 5 by switching generated calls topromise::handle, keeping Vert.x 4 support. Adds a Vert.x 5 Petstore sample and updates CI to build it.Bug Fixes
Java/libraries/vertx/api.mustache, usepromise::handlein default Future helpers (and auth variants) instead of passing thePromisedirectly.samples/client/petstore/java/vertx-supportVertxFutureAPIs to usepromise::handle.New Features
samples/client/petstore/java/vertx5-supportVertxFuturewith configbin/configs/java-vertx5-supportVertxFuture.yaml(useVertx5: "true",supportVertxFuture: "true")..github/workflows/samples-java-client-jdk11.yaml.Written for commit 5726692. Summary will update on new commits. Review in cubic