Multiple Converter Factory & Base Class for Retrofit.
kotlin ~ $
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
//add dependency
dependencies {
implementation 'com.github.jamesdeperio:RetrofitKit:v1.0.5'
//required dependencies
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
//add rxjava adapter
implementation 'com.squareup.retrofit2:adapter-rxjava2:x.x.x'
//or add Kotlin coroutine's adapter
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:x.x.x'
//then add your converter factory library
}
For better readability and understanding.
You can create your own converter and annotation the assign it.
Don't code too much! You can minify and remove boilerplate.
Read the documentation for better understanding and customization
Documentation