Hi, I'm using serialization 1.5.30 and I'm having a weird issue when I try to parse a JSON :
Copy code
Exception in thread "main" kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 0: Expected end of the object '}', but had '{' instead
JSON input: {"keywords":[],"softKeywords":[],"modifierKeywords":[],"specialIdentifiers":[],"operators":[]}
at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
at kotlinx.serialization.json.internal.JsonLexer.fail(JsonLexer.kt:493)
at kotlinx.serialization.json.internal.JsonLexer.fail(JsonLexer.kt:215)
s
sandwwraith
09/07/2021, 10:42 AM
What class are you trying to parse?
a
Ayfri
09/07/2021, 12:00 PM
Copy code
@Serializable
object Language {
val keywords = emptyList<String>()
val operators = emptyList<String>()
val softKeywords = emptyList<String>()
val modifierKeywords = emptyList<String>()
val specialIdentifiers = emptyList<String>()
}
Ayfri
09/07/2021, 12:02 PM
oh I'm dumb it's an object so it can't be instancied