Kotlinx.serialization: It is possible to parse Array of Arrays?

Created on 21 Aug 2019  路  1Comment  路  Source: Kotlin/kotlinx.serialization

I have the next valid JSON. but its possible to parse directly the array with the library, i could'nt found information about how to do it .

[
[
{
"body": "Text",
"bodyType": "Text",
"nameType": "Text",
"makeDisplay": "Acura"
}
],
[
{
"body": "text",
"bodyType": "text",
"nameType": "text",
"makeDisplay": "text"
}
]
]

question

Most helpful comment

Yes this is possible. You can parse it into a List<List<Type>>. You can can make a serializer using Type.serializer().list.list.

>All comments

Yes this is possible. You can parse it into a List<List<Type>>. You can can make a serializer using Type.serializer().list.list.

Was this page helpful?
0 / 5 - 0 ratings