I have a very complicated JSON file that looks like this:
{
"Animals": [
[
100,
"Mammals",
[
1,
"Cat",
50,
45,
57,
-1
],
[
2,
"Dog",
31,
44,
18,
-1
]
],
[
159,
"Reptiles",
[
1,
"Lizard",
11,
12,
9,
-1
]
]
]
}
I am attempting to parse this structure and somehow get scala objects out of it.
Here was my attempt:
case class Facts(number: Int, subTypeOfAnimal: String, data: List[Int])
case class Animaltype(value: Int, typeOfAnimal: String, characteristics: List[Facts])
case class Animal(rows: List[Animaltype])
This, of course, fails to convert the data. It returns a JNothing. I am wondering how I can express complex JArrays within JArrays of this kind properly.
Any help would be useful
Thanks!