Skip to content

[java-spring] - library spring-http-interface create swagger annotations if not explicitly configured to not do#23073

Open
atokle wants to merge 1 commit intoOpenAPITools:masterfrom
atokle:spring-http-interface-doc
Open

[java-spring] - library spring-http-interface create swagger annotations if not explicitly configured to not do#23073
atokle wants to merge 1 commit intoOpenAPITools:masterfrom
atokle:spring-http-interface-doc

Conversation

@atokle
Copy link

@atokle atokle commented Feb 28, 2026

When using spring generator with library=spring-http-interface it generates client code that should not have swagger annotations. But it's created anyaway, and without imports, so they wont even compile.

The implementation for this was trying to set these but got a bug, so additionalParameters already got values set for documentationProvider and annotationLibrary unless you specifically configure documentationProvider=none and annotationLibrary=none

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] "fixes [BUG][spring-http-interface]Missing Import when using spring-http-interface #15631"
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request. @cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08)

Summary by cubic

Fixes Spring HTTP Interface generation to stop adding Swagger/SpringDoc annotations that caused compile errors. Forces docs/annotation options to none for this library, disables bean validation, and defaults to Jakarta EE.

  • Bug Fixes

    • Force documentationProvider and annotationLibrary to none for library=spring-http-interface (conflicting user values are ignored).
    • Disable bean validation and default useJakartaEe=true; log a warning.
    • Call super.processOpts() after library-specific settings to prevent overrides.
    • Add a test to ensure PetApi has no @parameter annotations even when doc/annotation options are set.
  • Migration

    • No changes required; any annotationLibrary or documentationProvider you set will be ignored for this library.

Written for commit 43bccd0. Summary will update on new commits.

@atokle atokle force-pushed the spring-http-interface-doc branch from fbafb8d to 43bccd0 Compare February 28, 2026 14:07
Copy link
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 2 files

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.

[BUG][spring-http-interface]Missing Import when using spring-http-interface

1 participant