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":"[email protected]"}
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":"[email protected]"},
{"name":"Alice", "email":"[email protected]"},
{"name":"Jay", "email":"[email protected]"}]
into a List<Person>
? For example, this would be handy:
List<Person> persons = given().when().get("person/").as(...);