Given this json:
{
"id": "1",
"details": [{
"tax": [{
"amount": 1
},
{
"amount": 2
}]
}]
}
I'm trying to reading it in this way:
lazy val amounts: List[BigDecimal] = parse(json) \\ "amount" \ classOf[JDecimal]
But it's giving me an empty list, while using JDouble
like this:
lazy val amounts: List[Double] = parse(json) \\ "amount" \ classOf[JDouble]
It's giving me the correct list.
How can I directly read a list of BigDecimals
?