Need to extract the value of "id" where name is "SPECIAL" using Java. So, in below case we need to return "TMN456":
{
"data": {
"id": "12345",
"details": [
{
"id": "ABC123",
"name": "NORMAL",
"job": "JOB1"
},
{
"id": "PQR098",
"name": "BLUE COLLAR",
"job": "JOB2"
},
{
"id": "XYZ567",
"name": "HIGH-PAYING",
"job": "JOB3"
},
{
"id": "TMN456",
"name": "SPECIAL",
"job": "JOB4"
}
]
}
}
We can use json.org dependency in pom.