Add support for interface only with vertx - #24497
Conversation
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
please add the new folder to the github workflow: https://github.com/OpenAPITools/openapi-generator/blob/master/.github/workflows/samples-java-server-jdk8.yaml
|
please follow step 2 to update the samples and the documentation |
Add support for interfaceOnly with vertx-web
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.
Summary by cubic
Adds
interfaceOnlymode 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
interfaceOnlyoption forjava-vertx-web; generates*Apiand*Handleronly; skipsapiImpl.mustacheandHttpServerVerticle.apiHandler.mustache: remove deprecated no-arg constructor wheninterfaceOnly; 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.mustacheandREADME.mustacheadapt wheninterfaceOnly(no main verticle, shade/exec plugins, or run steps).bin/configs/java-vertx-web-server-interface-only.yaml, a Petstore sample atsamples/server/petstore/java-vertx-web-interface-only, and tests covering template selection, logging redaction, and file upload checks.Migration
-p interfaceOnly=true(oradditionalProperties.interfaceOnly: "true").Written for commit e2d707a. Summary will update on new commits.