Closed GoogleCodeExporter closed 9 years ago
Hi,
This looks like a bug. "properties" is a reserved word in Groovy which is not
handled correctly by REST Assured. For now please escape it manually, new
JsonPath("[{\"properties\":\"test\"}]").get("'properties'");.
Thanks for reporting.
Original comment by johan.ha...@gmail.com
on 2 May 2013 at 6:43
Ok so there seems to be two issues here. First off all "properties" is a
reserved key word in Groovy and RA didn't escape it properly. How ever even
though it's escaped properly it doesn't give the same result. Here's pure
Groovy code:
def json = new
groovy.json.JsonSlurper().parseText("[{\"properties\":\"test\"}]");
json.'properties'
Returns [class:class java.util.ArrayList, empty:false]
How ever:
def json = new groovy.json.JsonSlurper().parseText("[{\"property\":\"test\"}]");
json.'property'
Returns [test]
So it seems to be an issue/feature in Groovy and I don't think it's worth (or
even a good idea) to do anything about this.
How ever I will regard the issue as closed since "properties" is now
automatically escaped in RA.
Original comment by johan.ha...@gmail.com
on 29 May 2013 at 12:05
Original issue reported on code.google.com by
vanheus...@gmail.com
on 30 Apr 2013 at 2:38