My JSON response:
`
{
"resultCode": "SUCCESS",
"errorCode": null,
"errorMessage": null,
"membershipCoupons":
[
{
"membershipId": "3459",
"coupons":
[
{
"offerId": "000",
"description": "FELIX",
"graphics":
[
{
"width": 400,
"height": 200,
"quality": "Low",
"url": " http://www.someurl.com:8080/297Low.jpg"
},
{
"width": 900,
"height": 600,
"quality": "Hight",
"url": " http://www.someurl.com:8080/65F7High.jpg"
}
],
"endTime": 1417305600000,
"activationDate": null,
"redemption": null
},
{
"offerId": "000C29785F7",
"description": "this_thing_3 ",
"graphics":
[
{
"width": 400,
"height": 200,
"quality": "Low",
"url": " http://www.someurl.com:8080/D085F7Low.jpg"
},
{
"width": 900,
"height": 600,
"quality": "Hight",
"url": " http://www.someurl.com:8080/85F7High.jpg"
}
],
"endTime": 1417305600000,
"activationDate": 01112014,
"redemption": 01112014
},
{
"offerId": "000CF7",
"description": "Thing 7,- ",
"graphics":
[
{
"width": 400,
"height": 200,
"quality": "Low",
"url": " http://www.someurl.com:8080/0F7Low.jpg"
},
{
"width": 900,
"height": 600,
"quality": "Hight",
"url": " http://www.someurl.com:8080/7High.jpg"
}
],
"endTime": 1417305600000,
"activationDate": 04112014,
"redemption": 04112014
}
]
}
]
}
`
I need to save only the offerId where ‘activationDate=null’
Could this be done in an expression like this (tweaked to only save where ‘activationDate=null’ ?
.check(jsonPath("$.membershipCoupons[0].coupons[0].offerId").saveAs("offerId")))
`
`
or do I need to implement some scala code to extract only the ‘node’ with ‘activationDate=null’