Let's say I have a Java Person
class:
class Person {
String name;
String email;
}
With REST Assured, you can deserialize this JSON object
{"name":"Bob", "email":"bob@email.com"}
to a Java Person
instance using
Person bob = given().when().get("person/Bob/").as(Person.class);
How does one use REST Assured to deserialize this JSON array
[{"name":"Bob", "email":"bob@email.com"},
{"name":"Alice", "email":"alice@email.com"},
{"name":"Jay", "email":"jay@email.com"}]
into a List<Person>
? For example, this would be handy:
List<Person> persons = given().when().get("person/").as(...);