davecoleman
3 years agoContributor
JSONPath Existence Path error - InvalidPatchException
hi all,
I have the following JSON response and want to validate that as well as the parent node value checks that the sub elements are also correct.
{
"parent" : [
{
"country" : "RO",
"statusCode" : "NotFound"
},
{
"country" : "UK",
"statusCode" : "Found",
"foundEntity" : {
"respondingArea" : "Authority",
"entityDetails" : {
"NameDetails" : {
"familyName" : "Smith",
"firstName" : "John"
}
}
}
}
]
}
When I create a JSONPath existence match Assertion for following:
$..[?(@.country=="UK" && @.statusCode=="Found")] && $..[?(@.familyName=="Smith")]
I get the below error.
"InvalidPathException:Could not parse token starting at position" (after the double ambersand)
Testing via Jsonpath.com shows this is a valid jsonPath string and result given correctly.
Any alternatives to assert parent and child content that it exists otherwise in ReadyAPI?
thanks,
Dave