Anyone happen to know why my serializer I've written for an enum class is failing with this
JsonDecodingException
? What is strange is that it works in certain cases, but fails in others. When I get back this response:
{
"id": 1,
"status": 1,
"info": 0
}
It works fine and returns
IN_PROGRESS
. When I get this response:
{
"id": 3,
"status": 3,
"info": 0
}
I encounter this error:
kotlinx.serialization.json.JsonDecodingException: Invalid JSON at 28: Expected string or non-null literal
Which is thrown from
takeString()
in
JsonReader.kt
after trying to call
decodeInt()
. If both of them were failing I would be a little less confused, but with only one of them failing I am at a loss. Is it interpreting the
3
as a byte or something, and thus failing the
TC_OTHER
and
TC_STRING
check, whereas the
1
is interpreted as a
TC_STRING
somehow? All I can think of 🤔