@@ -7,50 +7,51 @@ import com.github.kittinunf.fuel.core.Response
77import com.github.kittinunf.fuel.core.ResponseDeserializable
88import com.github.kittinunf.fuel.core.response
99import com.github.kittinunf.result.Result
10- import kotlinx.io.InputStream
11- import kotlinx.io.Reader
1210import kotlinx.serialization.DeserializationStrategy
1311import kotlinx.serialization.ImplicitReflectionSerializer
1412import kotlinx.serialization.json.Json
13+ import kotlinx.serialization.json.JsonConfiguration
1514import kotlinx.serialization.serializer
15+ import java.io.InputStream
16+ import java.io.Reader
1617
1718inline fun <reified T : Any > Request.responseObject (
1819 loader : DeserializationStrategy <T >,
19- json : Json = Json .plain ,
20+ json : Json = Json ( JsonConfiguration . Stable ) ,
2021 noinline deserializer : (Request , Response , Result <T , FuelError >) -> Unit
2122) = response(kotlinxDeserializerOf(loader, json), deserializer)
2223
2324@ImplicitReflectionSerializer
2425inline fun <reified T : Any > Request.responseObject (
25- json : Json = Json .plain ,
26+ json : Json = Json ( JsonConfiguration . Stable ) ,
2627 noinline deserializer : (Request , Response , Result <T , FuelError >) -> Unit
2728) = responseObject(T ::class .serializer(), json, deserializer)
2829
2930inline fun <reified T : Any > Request.responseObject (
3031 deserializer : ResponseHandler <T >,
3132 loader : DeserializationStrategy <T >,
32- json : Json = Json .plain
33+ json : Json = Json ( JsonConfiguration . Stable )
3334) = response(kotlinxDeserializerOf(loader, json), deserializer)
3435
3536@ImplicitReflectionSerializer
3637inline fun <reified T : Any > Request.responseObject (
3738 deserializer : ResponseHandler <T >,
38- json : Json = Json .plain
39+ json : Json = Json ( JsonConfiguration . Stable )
3940) = responseObject(deserializer, T ::class .serializer(), json)
4041
4142inline fun <reified T : Any > Request.responseObject (
4243 loader : DeserializationStrategy <T >,
43- json : Json = Json .plain
44+ json : Json = Json ( JsonConfiguration . Stable )
4445) = response(kotlinxDeserializerOf(loader, json))
4546
4647@ImplicitReflectionSerializer
4748inline fun <reified T : Any > Request.responseObject (
48- json : Json = Json .plain
49+ json : Json = Json ( JsonConfiguration . Stable )
4950) = responseObject(T ::class .serializer(), json)
5051
5152inline fun <reified T : Any > kotlinxDeserializerOf (
5253 loader : DeserializationStrategy <T >,
53- json : Json = Json .plain
54+ json : Json = Json ( JsonConfiguration . Stable )
5455) = object : ResponseDeserializable <T > {
5556 override fun deserialize (content : String ): T ? = json.parse(loader, content)
5657 override fun deserialize (reader : Reader ): T ? = deserialize(reader.readText())
@@ -65,5 +66,5 @@ inline fun <reified T : Any> kotlinxDeserializerOf(
6566
6667@ImplicitReflectionSerializer
6768inline fun <reified T : Any > kotlinxDeserializerOf (
68- json : Json = Json .plain
69- ) = kotlinxDeserializerOf(T ::class .serializer(), json)
69+ json : Json = Json ( JsonConfiguration . Stable )
70+ ) = kotlinxDeserializerOf(T ::class .serializer(), json)
0 commit comments