Ask a Question

Version 5.7 stop support property transfer from Json

DanielMoutelik
New Contributor

Version 5.7 stop support property transfer from Json

DanielMoutelik_0-1642498233657.png $..routes.code[0]   - new result in  version 5.7  is empty    [[]]

get values for this json   not working

 

"routes": [
{
"code": "09003",
"default": true,

 

5 REPLIES 5
KarelHusa
Regular Contributor

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

 

{
"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
}

KarelHusa
Regular Contributor

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

 

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

@DanielMoutelik ,

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

 

cancel
Showing results for 
Search instead for 
Did you mean: