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

Constant names for Enums have changed with 2.2.12 #537

Closed
chberger opened this issue Oct 23, 2023 · 7 comments · Fixed by #541
Closed

Constant names for Enums have changed with 2.2.12 #537

chberger opened this issue Oct 23, 2023 · 7 comments · Fixed by #541

Comments

@chberger
Copy link
Contributor

I've updated quarkus-openapi-generator from 2.2.11 to 2.2.12. With that release it seems like constant names for enums will be determined in a different way.

Related PR: https://github.com/quarkiverse/quarkus-openapi-generator/pull/510/files#diff-72cbb66ba35c7356ee16cd4b1dc1ba37c30f4ad9af3d1ca8685a825f631b83be

Before version 2.2.12 a value of M123 led to a constant called M123. Now with that PR the enum constant has changed to M_M123.

⚠️ This is a breaking change which I would not expect in a patch update.

I've extended QuarkusJavaClientCodegenTest with two scenarios to showcase the behavior:
techspace-de@caac29d

The last two test parameters will fail:

rg.opentest4j.AssertionFailedError: 
expected: "M123"
 but was: "M_M123"
Expected :"M123"
Actual   :"M_M123"
<Click to see difference>


	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
..

and

rg.opentest4j.AssertionFailedError: 
expected: "MA456"
 but was: "MA_MA456"
Expected :"MA456"
Actual   :"MA_MA456"
<Click to see difference>


	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)

@chberger
Copy link
Contributor Author

CC @hbelmiro @fjtirado @ricardozanini @mcruzdev

@ricardozanini
Copy link
Member

@mcruzdev can you please take a look?

@michalsomora
Copy link
Contributor

The same issue is mentioned already here #421 (comment)

@mcruzdev
Copy link
Member

Hi @ricardozanini, of course!

@mcruzdev
Copy link
Member

Sorry for the delay, I was out, I am getting this issue now.

@mcruzdev
Copy link
Member

Hi @chberger, pull request opened #541.

@ricardozanini
Copy link
Member

@hbelmiro can you release a new patch version?

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 a pull request may close this issue.

4 participants