Problem to solve
I want to test whether - for example - jsonpath "$.emails[?(@.subject=='expected subject')].receivers" returns 2 receivers in the first occurrence of the array element containing expected subject` as subject.
This test has become impossible since 8.0, as there is now a "convenience" functionality that implicitly replaces an array with a single element with the single element itself, which breaks all scripts that rely on first.
Proposal
There are several solutions:
- Restore the 7.x behavior
- Restore the 7.x behavior when a option is passed to hurl
- Allow
first to accept objects or scalar values
Additional context and resources
Currently, I have no workaround for my use case. The exists predicate doesn't support my use case.
My original assertion was:
jsonpath "$.emails[?(@.subject=='expected subject')].receivers" first count == 2
Problem to solve
I want to test whether - for example -
jsonpath "$.emails[?(@.subject=='expected subject')].receivers" returns 2 receivers in the first occurrence of the array element containingexpected subject` as subject.This test has become impossible since 8.0, as there is now a "convenience" functionality that implicitly replaces an array with a single element with the single element itself, which breaks all scripts that rely on
first.Proposal
There are several solutions:
firstto accept objects or scalar valuesAdditional context and resources
Currently, I have no workaround for my use case. The
existspredicate doesn't support my use case.My original assertion was: