JSON
{
"customer":{
"address":{
"stateRegion":"",
"stateRegionCode":""
}
}
}
Code
"address.state_code": "$.customer.address.[stateRegion ? stateRegion: stateRegionCode?stateRegionCode: null]",
Here in the above expression , I want stateRegion as the value if it is present in customer as parent object and address as a child object , else I want stateRegionCode and if both are not present I want null, how can we customize this thing using jsonpath-plus?