com.jakewharton.retrofit2.converter.kotlinx.serialization.DeserializationStrategyConverter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of converter-kotlinx-serialization Show documentation
Show all versions of converter-kotlinx-serialization Show documentation
A Retrofit Converter which uses kotlinx.serialization for serialization.
The newest version!
package com.jakewharton.retrofit2.converter.kotlinx.serialization
import kotlinx.serialization.DeserializationStrategy
import okhttp3.ResponseBody
import retrofit2.Converter
internal class DeserializationStrategyConverter(
private val loader: DeserializationStrategy,
private val serializer: Serializer
) : Converter {
override fun convert(value: ResponseBody) = serializer.fromResponseBody(loader, value)
}