mercredi 4 novembre 2020

How to get child object from Dynamic Json Array?

I want to fetch child json node from Dynamic Json Array in JAVA.

Consider the below json sample.

[   
{
"UA::1001::2020-10-31::SFO::DEN::0::0": [
  {
    "id":123,
    "name":"sample"
  }
],
"UA::1053::2020-11-02::ORD::MIA::0::0": [
  {
    "id":432,
    "name":"demo"
  },
  {
    "id":443,
    "name":"test"
  }
]   ]

I want to fetch id:123 from 1st node where "UA::1001::2020-10-31::SFO::DEN::0::0" is dynamic in nature. I have tried jsonpath but no luck in retrieving the value.

Can someone help me in getting the node by any other means in JAVA?

Aucun commentaire:

Enregistrer un commentaire