MR3Y
07/26/2022, 9:02 PM{
"responseHeader": {
"a": 0,
"b": 407,
"c": {
....
}
},
"response": {
"numFound": 2,
"start": 0,
"docs": [
{
"foo": "foo",
"bar": "bar"
},
{
"foo": "foo",
"bar": "bar"
}
]
},
"unimportant": {
"unimportant": []
}
}
I'm interested only in the response
part, so, Instead of deserializing the entire response, I want to just deserialize this part. is this possible with kotlinx.serialization? Of course I can deserialize the whole response & get rid of the irrelevant parts on the client side, but this would be a waste of time. So, it would be nice if there is a built-in way to do this.ephemient
07/26/2022, 9:09 PMresponse
, and as long as you use Json { ignoreUnknownKeys = true }
having a partial model is fineephemient
07/26/2022, 9:09 PMresponseHeader
if it comes first, though. at a minimum it needs to match up quotes and bracketsMR3Y
07/26/2022, 10:46 PMpartial model + ignoreUnknownKeys
) but I'm getting JsonDecodingException
, this is why I asked the question in the first place, because I thought there is a hidden feature somewhere for that. but yeah, I guess you're right about JSON parser need to scan through responseHeader
and brackets first