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

Fix: Remove duplicate classes in nested polymorphic models #282

Conversation

y-marion
Copy link
Collaborator

@y-marion y-marion commented Apr 25, 2024

See issue #281 for detailed explanation

this also adds a test which compares the created model files (individual model files) to the generated files, to check for differences.
the changes in KotlinGenModels doesn't introduce changes in any other api files apart from the nestedPolymorphicModel file

Sorry for creating this many files, i wanted to make sure my changes didn't cause any regressions in the model generation of other api files

This filters the models in groupClasses again, to make sure no sealed
classes are generated multiple times.
GroupClasses was adding the child class to the superclass, even though
it created it's own class again because it's sealed and has children.
@y-marion
Copy link
Collaborator Author

Perhaps the test for models with the single file output could be deleted with this new test

@cjbooms
Copy link
Owner

cjbooms commented Apr 25, 2024

Perhaps the test for models with the single file output could be deleted with this new test

Yes, I think this is a good idea. Let's do that as a precursor PR so we can both see the problem you have found and fix you have provided. Nice work

@y-marion
Copy link
Collaborator Author

closing this in favor of #283 & #284 @cjbooms

@y-marion y-marion closed this Apr 25, 2024
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 this pull request may close these issues.

2 participants