What steps will reproduce the problem?
1. Provide a REST service returning a typed JSON array like this one : [ {
"foo": "foo", "bar": "bar" }, { "foo": "hello", "bar": "world" } ]
2. Try to call this service in rest-assured, then map it on a List<Foo> (where
Foo contains foo and bar fields) :
List<Foo> myList = expect().statusCode(200).when().get("/foos").as(List.class);
3. Since we have reified generics in Java, rest-assured cannot predict the
parameterized type of the List and then, will map the return type in a
List<Map> instead of a List<Foo>
Idea would be to provide a GSON-like approach with something looking like
TypeToken.
Discussion started on google group here :
https://groups.google.com/forum/#!topic/rest-assured/0GIQQfzC_6c
Original issue reported on code.google.com by fcamb...@gmail.com on 10 Jan 2012 at 8:08
Original issue reported on code.google.com by
fcamb...@gmail.com
on 10 Jan 2012 at 8:08