You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JVM Version, Operating System and Relevant Context
The bug occurs in when running my project on iOS in a multi-platform (android/iOS) project.
In Android it works as expected
Feedback
I've recently came across this bug Kotlin/kotlinx.serialization#360 . After upgrading both kotlinx-io and kotlinx-coroutines-io to version 0.1.5-dev-4 the issue no long occured when making live requests to server.
But when i use the mock engine, with an content bigger than 4088 chars i got this error: Invalid JSON at 4088: Unexpected end in string
If my content is smaller than 4088 it works fine.
Here's the code i use to create the MockEngin
valTOPOLOGY_ANSWER=""" VERY BIG JSON STRING"""val httpMockEngine =MockEngine {
when (url.toString()) {
"$baseUrl/${ApiEndpoints.TOPOLOGY}"-> {
MockHttpResponse(
call,
HttpStatusCode.OK,
ByteReadChannel(TOPOLOGY_ANSWER.toByteArray(Charsets.UTF_8)),
headersOf("Content-Type" to listOf(ContentType.Application.Json.toString()))
)
}
else-> {
error("Unhandled $url")
}
}
val client:HttpClient=HttpClient(httpMockEngine) {
install(JsonFeature) {
serializer =KotlinxSerializer(Json.nonstrict).apply {
setMapper(Topology::class, Topology.serializer())
}
}
Thanks in advance
The text was updated successfully, but these errors were encountered:
We're rebooting the kotlinx-io development (see #131), all issues related to the previous versions will be closed. Consider reopening it if the issue remains (or the feature is still missing) in a new version.
Ktor Version
1.1.2
###Kx.io Version
0.1.5-dev-4
Ktor Engine Used(client or server and name)
Ktor-client with MockEngine
JVM Version, Operating System and Relevant Context
The bug occurs in when running my project on iOS in a multi-platform (android/iOS) project.
In Android it works as expected
Feedback
I've recently came across this bug Kotlin/kotlinx.serialization#360 . After upgrading both kotlinx-io and kotlinx-coroutines-io to version 0.1.5-dev-4 the issue no long occured when making live requests to server.
But when i use the mock engine, with an
content
bigger than 4088 chars i got this error:Invalid JSON at 4088: Unexpected end in string
If my content is smaller than 4088 it works fine.
Here's the code i use to create the MockEngin
Thanks in advance
The text was updated successfully, but these errors were encountered: