a

    Ayfri

    1 year ago
    Hi, I'm using serialization 1.5.30 and I'm having a weird issue when I try to parse a JSON :
    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

    1 year ago
    What class are you trying to parse?
    a

    Ayfri

    1 year ago
    @Serializable
    object Language {
       val keywords = emptyList<String>()
       val operators = emptyList<String>()
       val softKeywords = emptyList<String>()
       val modifierKeywords = emptyList<String>()
       val specialIdentifiers = emptyList<String>()
    }
    oh I'm dumb it's an object so it can't be instancied