Thread
#serialization
    t

    Trond Tunheim

    2 years ago
    I'm using kotlinx serialization and have run into a strange problem. When i compile and run the code in DEBUG mode it works fine as expected, but when i compile the same code in RELEASE i get an exception. The code where the exception occurs is shown here :
    val json = Json(JsonConfiguration.Stable)
    var testJson = json.parse<JobInit>("{\"jobId\":\"j8203f1c50abe46338fa4d8955405949e\",\"jobStatus\":\"JobSubmitted\"}")
    @Serializable
    data class JobInit (val jobId : String = "", val jobStatus : String ="")
    When running in RELEASE I get the following exception : Uncaught Kotlin exception: kotlinx.serialization.json.JsonDecodingException: Invalid JSON at 0: Expected '[, kind: LIST' Anyone else had this problem or know what is wrong ? I'm using "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:0.14.0"
    s

    sandwwraith

    2 years ago
    Looks like a very strange error to me. Could you please file a github issue with reproducer?