Skip to content

feat: add quiet mode to suppress verbose generation output (#11211)#23831

Open
saxicek wants to merge 1 commit into
OpenAPITools:masterfrom
saxicek:saxicek/issue11211
Open

feat: add quiet mode to suppress verbose generation output (#11211)#23831
saxicek wants to merge 1 commit into
OpenAPITools:masterfrom
saxicek:saxicek/issue11211

Conversation

@saxicek
Copy link
Copy Markdown
Contributor

@saxicek saxicek commented May 20, 2026

Implement a --quiet / -q flag to suppress donation banners and contributor messages during code generation. This addresses issue #11211 by providing users a way to reduce noisy console output while maintaining full generation semantics.

Changes:

  • Add quiet mode configuration to WorkflowSettings (core module)
  • Wire quiet setting through CodegenConfigurator
  • Implement CLI option: -q, --quiet in Generate command
  • Add Maven plugin parameter: <quiet>true</quiet>
  • Add Gradle extension property: openApiGenerator.quiet = true
  • Refactor postProcess() in DefaultCodegen and 19 language generators to wrap println statements with if (!isQuietMode()) guard, ensuring all other lifecycle activities execute normally regardless of quiet mode
  • Add GlobalSettings lookup utility isQuietMode() to language-specific codegen
  • Update documentation for usage.md, Maven plugin README, Gradle plugin README
  • Add comprehensive test coverage across all modules:
    • WorkflowSettingsTest: quiet setting serialization
    • GenerateTest: CLI quiet flag parsing
    • DefaultGeneratorTest: postProcess execution verification
    • GenerateTaskDslTest: Gradle quiet output suppression
    • CodeGenMojoTest: Maven plugin quiet behavior

Verification:

  • DefaultGeneratorTest: 24 tests, 0 failures
  • GenerateTaskDslTest: all tests pass
  • Build: EXIT 0

This implementation maintains backward compatibility (quiet defaults to false) and ensures semantic correctness by always invoking postProcess(), affecting only the console output suppression behavior.

Closes #11211

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • 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.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • 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 a quiet mode to suppress donation and contributor banners during generation, available via CLI, Maven, and Gradle. Behavior is unchanged; postProcess still runs and quiet defaults to false.

  • New Features

    • CLI: -q, --quiet
    • Maven: <quiet>true</quiet> or openapi.generator.maven.plugin.quiet
    • Gradle: openApiGenerate.quiet = true
    • Core: WorkflowSettings and CodegenConfigurator#setQuiet, propagated via GlobalSettings
    • Docs and tests updated across CLI, Gradle, Maven, and generator lifecycle
  • Refactors

    • Wrapped banner prints in DefaultCodegen and language generators with if (!isQuietMode())
    • Added isQuietMode() helper; ensured postProcess() always executes

Written for commit daadd46. Summary will update on new commits. Review in cubic

…ols#11211)

Implement a `--quiet` / `-q` flag to suppress donation banners and contributor
messages during code generation. This addresses issue OpenAPITools#11211 by providing users
a way to reduce noisy console output while maintaining full generation semantics.

Changes:
- Add quiet mode configuration to WorkflowSettings (core module)
- Wire quiet setting through CodegenConfigurator
- Implement CLI option: `-q`, `--quiet` in Generate command
- Add Maven plugin parameter: `<quiet>true</quiet>`
- Add Gradle extension property: `openApiGenerator.quiet = true`
- Refactor postProcess() in DefaultCodegen and 19 language generators to wrap
  println statements with `if (!isQuietMode())` guard, ensuring all other
  lifecycle activities execute normally regardless of quiet mode
- Add GlobalSettings lookup utility `isQuietMode()` to language-specific codegen
- Update documentation for usage.md, Maven plugin README, Gradle plugin README
- Add comprehensive test coverage across all modules:
  * WorkflowSettingsTest: quiet setting serialization
  * GenerateTest: CLI quiet flag parsing
  * DefaultGeneratorTest: postProcess execution verification
  * GenerateTaskDslTest: Gradle quiet output suppression
  * CodeGenMojoTest: Maven plugin quiet behavior

Verification:
- DefaultGeneratorTest: 24 tests, 0 failures
- GenerateTaskDslTest: all tests pass
- Build: EXIT 0

This implementation maintains backward compatibility (quiet defaults to false)
and ensures semantic correctness by always invoking postProcess(), affecting
only the console output suppression behavior.

Closes OpenAPITools#11211
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 36 files

Re-trigger cubic

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 20, 2026

thanks for contributing this enhancement.

i'll review and let you know if i've any question or feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants