Skip to content

[Java][Spring] Ensure EnumConverterConfiguration.java is generated when interfaceOnly=true in Spring Generator#21000

Merged
wing328 merged 2 commits intoOpenAPITools:masterfrom
jorgerod:feature/GH-20999-generate-enumconverter-when-interfaceonly-is-enabled
Apr 9, 2025
Merged

[Java][Spring] Ensure EnumConverterConfiguration.java is generated when interfaceOnly=true in Spring Generator#21000
wing328 merged 2 commits intoOpenAPITools:masterfrom
jorgerod:feature/GH-20999-generate-enumconverter-when-interfaceonly-is-enabled

Conversation

@jorgerod
Copy link
Copy Markdown
Contributor

@jorgerod jorgerod commented Mar 31, 2025

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 Git BASH)
    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 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)

Fix this issue:

@wing328 wing328 merged commit 89f0f75 into OpenAPITools:master Apr 9, 2025
50 checks passed
@wing328 wing328 added this to the 7.13.0 milestone Apr 9, 2025
@jorgerod jorgerod deleted the feature/GH-20999-generate-enumconverter-when-interfaceonly-is-enabled branch April 9, 2025 09:12
@deluxe
Copy link
Copy Markdown

deluxe commented Jun 25, 2025

This feature is breaking code, please identify it as breaking in Release v7.13.0.

Where a Enum Converter with specific behaviour has already been defined, now generated EnumConverterConfiguration redefine another Converter and takes precedence in the Spring Context, overriding the specific behaviour with its generated, generic behaviour.

@lostiniceland
Copy link
Copy Markdown
Contributor

lostiniceland commented Aug 22, 2025

This breaks our code since we run the generator multiple times within one module due to several specs which causes the compiler to fail because now the Converters exist in multiple source roots with the same package.

I am struggling to get rid of this now. Am I supposed to provide an empty "supportingFiles" list?

We never missed this EnumConverters, so why make this a default. If some people want to have it, why not just add a flag in the config-options.

@Isukthar
Copy link
Copy Markdown

Hello, I have the same issue, project completely broken because of multiple EnumConverterConfiguration.java with same package.

Any news about this issue ?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants