Forum Discussion
5 Replies
- KarelHusaChampion Level 2
JSONPath as such is working in SoapUI 5.7.0 Property Transfer.
There might be something special about your JSON document. Could you please share your JSON document (in text)?
Best regards,
Karel
- DanielMoutelikNew Contributor
{
"firstName": "TEST2112",
"lastName": "TESTED2112",
"pin": "09431",
"company": "PPL CZ s.r.o",
"carrierId": 1547,
"departureDepot": {
"name": "Depo Olomouc",
"code": "09",
"gps": {
"latitude": 49.5596256,
"longitude": 17.2587353
},
"phone": null
},
"arrivalDepot": {
"name": "Depo Olomouc",
"code": "09",
"gps": {
"latitude": 49.5596256,
"longitude": 17.2587353
},
"phone": null
},
"routes": [
{
"code": "09003",
"default": true,
"secondWave": false
},
{
"code": "09009",
"default": false,
"secondWave": false
}
],
"cargolist": null,
"sequencing": false
}
- KarelHusaChampion Level 2
Since routes is an array, you need to:
- index the first route
- get the code of the route
In JSONPath:
$.routes[0].code
This JSONPath should be safe. Besides SoapUI you can check e.g. on https://jsonpath.com/ .
I assume the implementation of the JSONPath library used in SoapUI evolved during the time and that's why you see different results in SoapUI 5.5.0 and 5.7.0.
Best regards,
Karel
- DanielMoutelikNew Contributor
Sorry , I have more then 500 property transfer in my test . I have no time to rewrite each JSON only to work in new version 5.7
- KarelHusaChampion Level 2
I understand your point that updating large scripts to do the same as before is nothing to be happy about.
But anyway, I think this issue is more related to JSONPath than SoapUI 5.7.0 as other JSONPath implementations produce the same result as 5.7.0.
During the past years multiple JSONPath implementations emerged and evolved (Goessner, Nebhale, Jayway to name few), the website https://jsonpath.herokuapp.com/ provides a nice comparisson.
My conclusion is to use the safest possible JSONPath (works in multiple implementations). Then there's high probability it will work in different times and places.
Similarly, also other REST API technologies lack standardisation and the tools still aren't as mature as their counterparts in WSDL/SOAP/XML stack.
Regarding the bulk updates of SoapUI projects -- editing project xml (either by scripts or by smart text editor) is the most efficient method for me, even hundreds of changes can be done quite quickly.
Best regards,
Karel
Related Content
- 5 years ago
- 2 years ago
- 9 years ago
Recent Discussions
- 3 days ago