kotlinx.serialization
kotlinx.serialization copied to clipboard
Different behaviour of encodeToString and encodeToJsonElement on iOS simulator and physical iOS device or android simulator
Describe the bug This code:
data class Req(val id: Int)
val req = Req(id = 5000)
Json.encodeToString(req)
on the physical device iOS and on the emulator android works correctly, but on the iOS emulator, the length of the literal is put in json instead of the field value.
{
"id": 4
}
To Reproduce
data class Req(val id: Int)
val req = Req(id = 5000)
Json.encodeToString(req)
Expected behavior Getting the correct json on the ios emulator
{
"id": 5000
}
Environment
- Kotlin version: 1.6.10
- Library version: 1.3.1
- Kotlin platforms: Native
- Gradle version: 7.1.3
- IDE version: XCode 13.1 / AS 2021.2.1 Patch 1
- Other relevant context: simulator iPhone 11 iOS 15.0
Hi, do you by any chance have an open-source reproducer?
Please reopen if the issue is still actual.