galex
03/15/2019, 7:02 AMkotlin.NotImplementedError: An operation is not implemented: Obtaining serializer from KClass is not available on native due to the lack of reflection. Use .serializer() directly on serializable class.
After adding the .serializer()
to Json.stringify
I get the following error and I am not sure how to specify the serializer() for the receiving/parsing part:
io.ktor.client.call.ReceivePipelineException: Fail to run receive pipeline
Here’s my request:
val result: ActionResponse = <http://networkHttpClient.post|networkHttpClient.post> {
url(address)
body = TextContent(Json.stringify(Event.serializer(), event), contentType = ContentType.Application.Json)
}
e5l
03/15/2019, 7:52 AMgalex
03/15/2019, 7:53 AMgalex
03/15/2019, 8:07 AMio.ktor.client.call.ReceivePipelineException: Fail to run receive pipeline
io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.client.engine.ios.IosHttpResponse -> class
com.analytics.core.network.model.ActionResponse
galex
03/15/2019, 8:08 AMe5l
03/15/2019, 8:08 AM1.2.0
🙂galex
03/15/2019, 8:11 AMgalex
03/15/2019, 8:11 AMe5l
03/15/2019, 8:12 AM1.2.0-alpha-1
but wo iOS for now.galex
03/15/2019, 8:15 AMgalex
03/15/2019, 8:15 AMe5l
03/15/2019, 8:18 AMgalex
03/15/2019, 8:19 AMactual val networkHttpClient: HttpClient
get() = HttpClient {
install(JsonFeature) {
serializer = KotlinxSerializer(Json(encodeDefaults = false)).apply {
setMapper(Event::class, Event.serializer())
setMapper(ActionResponse::class, ActionResponse.serializer())
}
}
}
Correct?galex
03/15/2019, 8:21 AMgalex
03/15/2019, 8:26 AM