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 missing inner enum import on operations #79

Merged

Conversation

cortinico
Copy link
Collaborator

Previously inner types of complex types were not imported properly on
operations. This resulted in Retrofit interfaces missing some imports.

This commit introduces methods to inspect and import the inner types
used as result types of operations.

Fixes #76

Ping @macisamuele for the review

@cortinico cortinico mentioned this pull request Dec 26, 2019
Copy link
Collaborator

@macisamuele macisamuele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the change looks good.
I would suggest a small refactor in order to make the new methods independent from Kotlin.

Something else that would be nice to check is related to inlined models into requests parameters (it might be done into a different PR as well).

PS: personally I would have replaced isMapTypeWrapped with a regex matching of the mapTypeWrapper (but not blocking)

plugin/src/main/java/com/yelp/codegen/KotlinGenerator.kt Outdated Show resolved Hide resolved
plugin/src/main/java/com/yelp/codegen/KotlinGenerator.kt Outdated Show resolved Hide resolved
plugin/src/main/java/com/yelp/codegen/KotlinGenerator.kt Outdated Show resolved Hide resolved
plugin/src/main/java/com/yelp/codegen/KotlinGenerator.kt Outdated Show resolved Hide resolved
Previously inner types of complex types were not imported properly on
operations. This resulted in Retrofit interfaces missing some imports.

This commit introduces methods to inspect and import the inner types
used as result types of operations.

Fixes Yelp#76
@cortinico cortinico force-pushed the fix-76-missing-inner-enum-import branch from 84b2b50 to 54b94dd Compare January 1, 2020 21:14
@cortinico
Copy link
Collaborator Author

@macisamuele ready for another pass :) I've addressed all the comments.

PS: personally I would have replaced isMapTypeWrapped with a regex matching of
the mapTypeWrapper (but not blocking)

You're more than welcome to add it once this gets merged :)

@macisamuele macisamuele merged commit b1fbc34 into Yelp:master Jan 2, 2020
@cortinico cortinico added this to the 1.3.0 milestone Jan 20, 2020
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.

Missing enum import
2 participants