I need to get to code
of an array element that has field
== firstName
:
{
"errors": [
{
"field": "firstName",
"code": "NotBlank"
},
{
"field": "lastName",
"code": "NotBlank"
}
]
}
With JsonPath, the way to do it is $.errors[?(@.field == firstName)].code
. How do I do the same in Rest Assured with its GPath syntax?
Haven't tried it but from the top of my head this ought to work: