-
Notifications
You must be signed in to change notification settings - Fork 102
Swap Moshi for GSON to address Type erasure problems in network requests #157
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
Conversation
|
SonarCloud Quality Gate failed. |
Peter-John-paystack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I see we moving away from Gson, can you provide a reason for this? This feels like a big change all of a sudden. Why was it working before and is not working anymore I guess is the question.
| google() | ||
| mavenCentral() | ||
| google() | ||
| jcenter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not be removing Jcenter? Do we need it for anything ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are couple of libraries we haven't updated to versions shipped in MavenCentral. I'm reluctant to make those changes here but we can schedule them @Peter-John-paystack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Peter-John-paystack we're moving away from GSON because the new data access classes are all in Kotlin.
Because of Java's type erasure, GSON cannot resolve the return types for the retrofit service functions and it makes the service calls fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool happy with the Jcenter, but why Moshi and not Kotlin serialisable just out of interest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It caused quite a number of conflicts with the kotlin version that was already in the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok cool cool, lets just make sure that we are going to do regression testing on all functionality if we are making this change please. 😊








Fixes an issue from version 3.3.1 where network requests fail because of response parsing problems related to Java's type erasure.
This PR swaps GSON for Moshi for better compatibility with Kotlin