Opt in to experimental kotlinx.serialization API locally

Change-Id: Ibc88151f5a8b7a3a82e2c0043839c1cb9e016bcf
pull/307/head
Márton Braun 2 years ago
parent 4a1fb58c34
commit 5fd5d17caf

@ -57,8 +57,6 @@ internal fun Project.configureKotlinAndroid(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
"-opt-in=kotlin.Experimental",
// Enable experimental kotlinx serialization APIs
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi"
)
// Set JVM target to 1.8

@ -25,6 +25,7 @@ import com.google.samples.apps.nowinandroid.core.network.model.NetworkTopic
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import javax.inject.Inject
import javax.inject.Singleton
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
import okhttp3.MediaType.Companion.toMediaType
@ -99,7 +100,10 @@ class RetrofitNiaNetwork @Inject constructor(
)
.build()
)
.addConverterFactory(networkJson.asConverterFactory("application/json".toMediaType()))
.addConverterFactory(
@OptIn(ExperimentalSerializationApi::class)
networkJson.asConverterFactory("application/json".toMediaType())
)
.build()
.create(RetrofitNiaNetworkApi::class.java)

Loading…
Cancel
Save