i have a funny json data looking as:
[ {
\"internal_network\" : [ {
\"address\" : [ {
\"address_id\" : 2,
\"address\" : \"172.16.20.1/24\"
The error is telling you that instead of /switch_id
it got an array. So it seems like you should read the JSON as a List[Switch]
instead of just Switch
Assuming your Reads
(didn't test them) are correct this should work:
val json: JsValue = Json.parse(jsonChunk)
println(json.validate[List[TheSwitch]])