Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][JAVA][SPRING] Configuration Bean names collide #17737

Open
3 of 6 tasks
Tomschi opened this issue Jan 29, 2024 · 2 comments
Open
3 of 6 tasks

[BUG][JAVA][SPRING] Configuration Bean names collide #17737

Tomschi opened this issue Jan 29, 2024 · 2 comments

Comments

@Tomschi
Copy link

Tomschi commented Jan 29, 2024

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Spring defaults to naming many beans by either class or method names. When using multiple openapi.yaml files (e.g. for a versioning strategy), these names can collide and fail start up.
In my case the occurrence of multiple EnumConverterConfiguration's produces the issue.

Suggest a fix

Change @configuration Annotation in converter.mustache fixes the issue:

@Configuration(value = "{{configPackage}}.enumConverterConfiguration")

Fix is implemented in PR: #17738

@martin-mfg
Copy link
Contributor

Hi, could you please provide a concrete example how to reproduce the problem? Thanks!

@Tomschi
Copy link
Author

Tomschi commented Jul 2, 2024

Hi,
here is a repo with an example: https://github.com/Tomschi/openapi-generator-issues
Running the main class reproduces the issue.

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

No branches or pull requests

2 participants