See this post including my solution:
It’s messy but possible. It’s certainly better when the JSON is a dictionary but you can work with arrays.