Add support for interface only with vertx

Closed
CO
2mo ago
+2579-16

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").