Skip to content

Add support for interface only with vertx - #24497

Open
corbs9 wants to merge 9 commits into
OpenAPITools:masterfrom
corbs9:add-support-for-interface-only-with-vertx
Open

Add support for interface only with vertx#24497
corbs9 wants to merge 9 commits into
OpenAPITools:masterfrom
corbs9:add-support-for-interface-only-with-vertx

Conversation

@corbs9

@corbs9 corbs9 commented Jul 26, 2026

Copy link
Copy Markdown

Add support for interfaceOnly with vertx-web

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    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.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Adds interfaceOnly mode to the Vert.x Web server generator to output only API interfaces and handlers, skipping server bootstrap and impl stubs. Also improves handler logging and file upload validation, with samples and tests.

  • New Features

    • New interfaceOnly option for java-vertx-web; generates *Api and *Handler only; skips apiImpl.mustache and HttpServerVerticle.
    • apiHandler.mustache: remove deprecated no-arg constructor when interfaceOnly; redact password params and omit request bodies in debug logs.
    • formParams.mustache: return 400 when a required file upload is missing; otherwise allow null instead of assuming a file.
    • pom.mustache and README.mustache adapt when interfaceOnly (no main verticle, shade/exec plugins, or run steps).
    • Added bin/configs/java-vertx-web-server-interface-only.yaml, a Petstore sample at samples/server/petstore/java-vertx-web-interface-only, and tests covering template selection, logging redaction, and file upload checks.
  • Migration

    • No breaking changes. Default behavior stays the same; enable with -p interfaceOnly=true (or additionalProperties.interfaceOnly: "true").

Written for commit e2d707a. Summary will update on new commits.

Review in cubic

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 24 files

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/java/org/openapitools/codegen/languages/JavaVertXWebServerCodegen.java">

<violation number="1" location="modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXWebServerCodegen.java:111">
P2: `interfaceOnly=true` output cannot run its generated Maven project: the POM still configures `HttpServerVerticle`, which this branch no longer generates. Make the POM/README interface-only-aware or omit server-launch configuration with the verticle.</violation>
</file>

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

apiTemplateFiles.clear();
apiTemplateFiles.put("api.mustache", ".java");
apiTemplateFiles.put("apiHandler.mustache", "Handler.java");
if (!interfaceOnly) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: interfaceOnly=true output cannot run its generated Maven project: the POM still configures HttpServerVerticle, which this branch no longer generates. Make the POM/README interface-only-aware or omit server-launch configuration with the verticle.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXWebServerCodegen.java, line 111:

<comment>`interfaceOnly=true` output cannot run its generated Maven project: the POM still configures `HttpServerVerticle`, which this branch no longer generates. Make the POM/README interface-only-aware or omit server-launch configuration with the verticle.</comment>

<file context>
@@ -100,6 +100,18 @@ public String getHelp() {
+        apiTemplateFiles.clear();
+        apiTemplateFiles.put("api.mustache", ".java");
+        apiTemplateFiles.put("apiHandler.mustache", "Handler.java");
+        if (!interfaceOnly) {
+            apiTemplateFiles.put("apiImpl.mustache", "Impl.java");
+        }
</file context>

@corbs9 corbs9 Jul 27, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

resolved in prior commit

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 11 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@@ -0,0 +1,8 @@
generatorName: java-vertx-web
outputDir: samples/server/petstore/java-vertx-web-interface-only

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wing328

wing328 commented Jul 27, 2026

Copy link
Copy Markdown
Member

please follow step 2 to update the samples and the documentation

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