I have two questions:
- How to map a list of JSON objects using Spring RestTemplate.
- How to map nested JSON objects.
I am trying to consume https://bitpay.com/api/rates, by following the tutorial from http://spring.io/guides/gs/consuming-rest/.
javaresttemplatespring
I have two questions:
I am trying to consume https://bitpay.com/api/rates, by following the tutorial from http://spring.io/guides/gs/consuming-rest/.
Best Answer
First define an object to hold the entity coming back in the array.. e.g.
Then you can consume the service and get a strongly typed list via:
The other solutions above will also work, but I like getting a strongly typed list back instead of an Object[].