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
class CustomConverterFactory(gson: Gson) : Converter.Factory() { | |
private val gsonConverterFactory: GsonConverterFactory = GsonConverterFactory.create(gson) | |
override fun responseBodyConverter(type: Type, annotations: Array<Annotation>, retrofit: Retrofit): Converter<ResponseBody, *>? { | |
val wrappedType = object : ParameterizedType { | |
override fun getActualTypeArguments(): Array<Type> = arrayOf(type) | |
override fun getOwnerType(): Type? = null | |
override fun getRawType(): Type = Data::class.java | |
} |