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
packageli.songe.gkdimportkotlinx.serialization.json.Jsonimportorg.junit.TestclassExampleUnitTest {
@Test
funcheck() {
val json =Json {
isLenient =true
}
val okStr =""" { a: ['a'] }""".trimIndent()
println(json.parseToJsonElement(okStr))
val errStr =""" { a: ['['] }""".trimIndent()
println(json.parseToJsonElement(errStr))
}
}
Expected behavior
parse success
Actual behavior
{"a":['a']}
Unexpected JSON token at offset 10: Expected end of the array or comma at path: $
JSON input: {
a: ['[']
}
kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 10: Expected end of the array or comma at path: $
JSON input: {
a: ['[']
}
Environment
Kotlin version: [2.0.10]
Library version: [1.7.1]
Kotlin platforms: [JVM]
Gradle version: [8.9]
The text was updated successfully, but these errors were encountered:
Describe the bug
To Reproduce
Expected behavior
parse success
Actual behavior
Environment
The text was updated successfully, but these errors were encountered: