mercredi 24 mars 2021

jsonPath - problem with accessing to field by index

I trying access to value Carrier by taking value from shipping_id. I testing queries at https://www.jsonquerytool.com/. If I type key by hand $.shipping_methods["11"] or $.shipping_methods.11I receive correct result ["Carrier"]. But I have problem with taking key value from shipping_id field. I was trying with many variations of this $.shipping_methods[$.shipping_id] but without success. It's possible with pure jsonPath?

{
   "shipping_id":"11",
   "shipping_methods":{
      "10":"Post",
      "11":"Carrier"
   }
}



Aucun commentaire:

Enregistrer un commentaire