(I’ve initially posted this in <#C0A974TJ9|ktor> b...
# serialization
j
(I’ve initially posted this in #ktor but it feels like it might make more sense to ask here: ---- Hello fellow kotliners, I’m haivng an issue where my ktor client is not parsing the response correctly.. The body “ends” unexpectedly, looking at the logs is simply stops “parsing the json” from the response. I’ve double checked with postman and the response from the API is correct.
[14:55] kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 82: Expected string literal with quotes.
For some context the body seems to be cut randomly and the rest of the response is not parsed, using latest versions for both ktor and kotlinx.serialisation
r
It looks like a mismatch between the json and your classes, are you sure the response matches your model? Maybe it returns a number where your model expects a string?
j
@rnentjes thanks to your reply I went drilling down to every single model I had and you were right, there was a change in the API response. My only complaint is the error message, why wouldn’t it just say something related to model vs schema?