
com.jakewharton.retrofit2.converter.kotlinx.serialization.SerializationStrategyConverter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of retrofit2-kotlinx-serialization-converter Show documentation
Show all versions of retrofit2-kotlinx-serialization-converter Show documentation
A Converter.Factory for Kotlin's serialization support.
package com.jakewharton.retrofit2.converter.kotlinx.serialization
import kotlinx.serialization.SerializationStrategy
import okhttp3.MediaType
import okhttp3.RequestBody
import retrofit2.Converter
internal class SerializationStrategyConverter(
private val contentType: MediaType,
private val saver: SerializationStrategy,
private val serializer: Serializer
) : Converter {
override fun convert(value: T) = serializer.toRequestBody(contentType, saver, value)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy