BUG? JSONPath Existence Match cannot use condition
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
BUG? JSONPath Existence Match cannot use condition
This was discovered when I chatted about a different issue in the forum. I am posting it here so the problem is more clear and hope to get some attention. Let's say I have a response like below
{"errors": [{
"code": "100",
"message": "Message for 100",
},
{
"code": "200",
"message": "Message for 200",
}
]}
I created "JSONPath Existence Match" asserts as below
Expression: $..errors[?(@.code == 100)]
Expected result: true
Expression: $..errors[?(@.code == 800)]
Expected result: false
I would think both VALID, i.e. the actaul result of the second expression would be false. However, the actual result was true. The second assertion failed with the error:
-> Comparision failed for path [$..errors[?(@.code == 800)]], expecting [false], and actual was [true]
However, if I create "JSONPath Count" asserts instead as shown below:
Expression: $..errors[?(@.code == 100)]
Expected result: 1
Expression: $..errors[?(@.code == 800)]
Expected result: 0
Both assertion will be VALID, i.e. the actual result of the second expression will be 0 (which is the expected value).
This is not consistent! Should this be a BUG?
I tried this on both SoapUI OpenSource 5.2.1 and the SoapUI NG Pro 1.5.0 (ReadyAPI 1.5.0). They all behave the same.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrew_net,
Thanks for reporting this behavior. I’ve reproduced a similar issue and reported it to our R&D Team. Let’s wait for the news from them.
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrew_net,
Sorry that it took me so long to get back to you.
I’ve got the confirmation from our R&D Team that this issue had been fixed in our maintenance Ready! API 1.6 build. You can download it here:
https://support.smartbear.com/downloads/readyapi/nightly-builds/
Please let me know if the issue still persists.
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tanya,
Thanks for getting back to me.
This is really good news! Unfortunately, I cannot test it on Ready API since my trial license is expired and I am still waiting for the approval of the real license. I tried to install the maintenance build and it still tells me the trail license is expired.
Do you know if the change went into SoapUI open software version? Is there a maintenance build for the open software version I can test this on?
Thanks.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrew_net,
As far as I know, the changes were done only in Ready! API. Have you already contacted anyone from SmartBear to prolong your trial period? I think they will provide you with a new license key.
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tanya,
My license request finally went through and I verified that the maintainence build did resolve the problem.
Thanks a lot.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great to hear this, Andrew 🙂
Tanya Yatskovskaya
SmartBear Community and Education Manager
