-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9746802
commit 873f9e4
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# moshi-gson-interop-retrofit-converter | ||
|
||
A [Retrofit](https://square.github.io/retrofit/) converter that converts both [Gson](https://github.com/google/gson) and [Moshi](https://github.com/square/moshi) models. | ||
|
||
This tool can be used in the projec where both `Gson` and `Moshi` are present. | ||
|
||
Note that, this won't work if a particular model class is mixed with both Gson and Moshi. | ||
This basically checks the root class of the response type and if it is a Gson model, all of its fields will also be parsed as Gson. And if it is a Moshi model, all of its fields will be parsed as Moshi | ||
|
||
# Installation | ||
|
||
Add to _build.gradle_: | ||
```groovy | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
``` | ||
Add the dependency | ||
```groovy | ||
implementation 'com.github.muthuraj57:moshi-gson-interop-retrofit-converter:1.0.0' | ||
``` |