-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Java] Fixing subClassed types so that they can use enums #1051
Conversation
I don't quite get this yet. Could you please add a test to verify the results of this? |
Here's a repro:
Repro output:
|
@fehguy I'll put some tests together. |
Ping @fehguy - I added a test for this |
Hey @xhh, could I get your opinion on this PR? The same bug probably exists in the Android (and maybe Scala) generators. |
@wing328 what do you think on this one? |
Tested and was able to repeat the compile error, which's addressed by this PR. Compared with the prevention approach, this approach (post-processing) is preferable in my opinion. |
[Java] Fixing subClassed types so that they can use enums
Thank you, @wing328 ! |
This fixes #1050 .
The bug repros if your models use inheritance and enums together. In this event, swagger-codegen output is invalid Java code and will not compile. This is due to a type conflict with the properties copied from the parent class. The solution proposed in this PR is to remove any enums from child classes that already exist in the parent class.