Skip to content

Conversation

@michael-paystack
Copy link
Member

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

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

16.1% 16.1% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@Peter-John-paystack Peter-John-paystack left a 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()
Copy link
Collaborator

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 ?

Copy link
Member Author

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

Copy link
Member Author

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.

Copy link
Collaborator

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?

Copy link
Member Author

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.

Copy link
Collaborator

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. 😊

@michael-paystack michael-paystack merged commit 25a2335 into master Mar 29, 2023
@michael-paystack michael-paystack deleted the fix/MOB-290/gson-to-moshi branch March 29, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants