-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Duplicated values in enum throw IllegalStateException #6829
Comments
Looks like For example: enum Action {
@JsonAlias({ "Replace", "replace" })
REPLACE,
@JsonAlias({ "Keep", "keep" })
KEEP,
@JsonAlias({ "Drop", "drop" })
DROP;
} It would be great to have the generator using this annotation instead of adding duplicates. |
@manusa @andreaTP this was already fixed upstream with sundrio/sundrio#470 Changing the java generation as heruan suggests could be done as well, but without additional information I'm a little fuzzy on how the user would control which casing was ultimately used. |
I'm a little confused: is a CRD enum with casing variations currently not supported? Seems common, at least it's used in widely used operators as in CloudNativePG. Am I missing some option to generate types compatible with Sundrio processor? |
Describe the bug
I'm generating class files with Fabric8 Gradle plugin (7.0.1) from the CloudNativePG CRDs (extra annotations enabled). When Sundrio's processes annotations, it fails with:
I assume this is related to this part of the CRD:
But I cannot change the CRD nor the generated classes. I've tried setting
uppercaseEnums
both to true and false, same error.Is it possible for the generator to skip duplicated enums?
Fabric8 Kubernetes Client version
SNAPSHOT
Steps to reproduce
Run the generator with extra annotations on a CRD that has enums like:
The enum will be generated as
or, if
enumUppercase=false
, asIn both cases, Sundrio will fail with:
Expected behavior
An enum without duplicated value, like:
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.25.3@latest
Environment
macOS
Fabric8 Kubernetes Client Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: