-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Error getting values from Enum when using Groovy #6760
Labels
lang: groovy
Issues or features specific to Groovy
Milestone
Comments
3 tasks
Could just hard-code the exclusion for MIN_VALUE and MAX_VALUE |
I though about it but it feels dirty... If there is no other way, I can do it. |
ilopmar
added a commit
that referenced
this issue
Jan 17, 2022
jameskleeh
pushed a commit
that referenced
this issue
Jan 18, 2022
yawkat
pushed a commit
that referenced
this issue
Jan 21, 2022
yawkat
pushed a commit
that referenced
this issue
Jun 24, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
When using Groovy and getting the values from an
enum
having anEnumElement
, Micronaut should return the right values.Actual Behaviour
Given the following Groovy Enum:
When processing it in micronaut-openapi to get the values, Micronaut returns
DOG
,CAT
,MIN_VALUE
andMAX_VALUE
and it should only returnDOG
andCAT
.The issues is here https://github.com/micronaut-projects/micronaut-core/blob/3.2.x/inject-groovy/src/main/groovy/io/micronaut/ast/groovy/visitor/GroovyEnumElement.java#L56-L60 but while debugging I can't find a way to differentiate those extra values from the "right" ones.
This only happens with Groovy, it works properly with Java.
Related Micronaut OpenAPI issue that should be closed when this is fixed micronaut-projects/micronaut-openapi#358
Steps To Reproduce
No response
Environment Information
Linux Mint 20.3
JDK 8
Example Application
No response
Version
3.2.6
The text was updated successfully, but these errors were encountered: