Forum Discussion
Hi navneet_goyal ,
it seems to me that your JSONPath tries to apply two selections:
- all punches: [*]
- only punches with [?(@.hasComments==true)]
This JSONPath gives punches with hasComments==true:
$.punches[?(@.hasComments==true)].commentsNotes[0].comment.name
This JSONPath gives you all punches:
$.punches[*].commentsNotes[0].comment.name
I assume the different behavior is caused by the upgrade of Jayway jsonpath library to version 2.4.0. See SoapUI 5.7.0 release notes: https://www.soapui.org/downloads/latest-release/release-notes/ .
Best regards,
Karel
- navneet_goyal3 years agoNew Contributor
Hi KarelHusa
Do you recommend modifying all existing tests to reflect the new format for JSON path or do you expect this behavior might change in future releases of SopaUI?
Thanks,
Navneet
- KarelHusa3 years agoChampion Level 1
I cannot predict what happens in future versions of SoapUI, but still do not expect changes in basic JSONPath handling.
There were different opinions in the past how JSONPath should work (some opinions tended to XPath-like behavior) and so it's implementation evolved during the last years. SoapUI 5.7.0 has updated JSONPath Jayway library from 0.9.1 to 2.4.0.
You can check a detailed explanation with examples.
You can also see this thread related to JSONPath changes in SoapUI 5.7.0.
I would recommend to change the JSONPath strings to safer format. And where you are not sure test it (without exposing sensitive data) in https://jsonpath.com/ or similar tool.
Best regards,
Karel
Related Content
- 4 years ago
Recent Discussions
- 18 hours ago