I have the following JSON string:
{
"myKey": "myValue"
}
I want to check whether this string is not empty. I can do this:
$.myKey
to get the value of myKey. I've tried changing it to
$.[?(@.myKey.length()>0)]
(as per this topic Expression to filter out elements with empty arrays using `jsonPath`) or even this:
$.myKey.length()>0
but I get error that it is not a valid JSONPath expression.
I add "JsonPath Match" to the test step in my project. When I set it to
$.myKey
and press "Select from current", it works. For
$.[?(@.myKey != '')]
when I press "Select from current", I get
"Invalid JsonPath expression"
I use SoapUI 5.4.0 but I don't know how to check its JsonPath implementation. I want to get false if string is empty.
How can I check whether myValue is empty or not? Thanks!