I'm facing difficulty in extracting the values using JsonPath. Here is my json,
applications:[
{
"ab": 123,
"isReady": true,
"proId": 234
},
{
"ab": 345,
"isReady": false,
"proId": 098
},
{
"ab": 332,
"isReady": true,
"proId": 100
}
]
I wanted to extract values of "ab" and "proId" when "isReady" value is true. And once it is done, I need to construct the below json with above mentioned values. Example below,
[
{
"ab": 332,
"proId": 100
},
{
"ab": 123,
"proId": 234
}
]
I can only be able to extract single values like below,
List<Integer> abList = jsonFindAllUserJobApplicantsResponse.get("applications.findAll{ it.isReady == true}.ab");
List<Integer> proIdList = jsonFindAllUserJobApplicantsResponse.get("applications.findAll{ it.isReady == true}.proId");
Could you please help in this scenario on how to extract and construct the desired result?
Thanks a lot for your help.