sahaya / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Does not returns 0th element of root list #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Given response: [{'a': 'a value'}]. Needed to retrieve 0th element.
2. Map<String, String> m = from(body).get("$[0]");

Expected m to keep value. Actually: m - null.

What version of the product are you using? On what operating system?
OS X, Rest Assured 1.6

Original issue reported on code.google.com by miccots@gmail.com on 8 Mar 2012 at 3:44

GoogleCodeExporter commented 9 years ago
Thanks to unit-tests, figured out that it can be retrieved like 
from(body).get("[0]"). Think it would ne nice if documentation covers this case 
which is pretty common for rest services.

Original comment by miccots@gmail.com on 8 Mar 2012 at 7:00

GoogleCodeExporter commented 9 years ago
Glad that you found a solution. Perhaps you could help out by writing a small 
piece of documentation for this and I'll add it to the docs?

Original comment by johan.ha...@gmail.com on 9 Mar 2012 at 12:55