Repository navigation
[Java] Fixing subClassed types so that they can use enums - #1051
Merged
Merged
Conversation
Contributor
|
I don't quite get this yet. Could you please add a test to verify the results of this? |
Contributor
Author
|
Here's a repro: Repro output: |
Contributor
Author
|
@fehguy I'll put some tests together. |
Contributor
Author
|
Ping @fehguy - I added a test for this |
Contributor
Author
|
Hey @xhh, could I get your opinion on this PR? The same bug probably exists in the Android (and maybe Scala) generators. |
Contributor
Author
Contributor
|
@wing328 what do you think on this one? |
Contributor
|
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. |
wing328
added a commit
that referenced
this pull request
Aug 20, 2015
[Java] Fixing subClassed types so that they can use enums
Contributor
Author
|
Thank you, @wing328 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.