I am parsing the incoming JSON and checking for a surname value. If it starts with 'C' then response should be sent back, else reject it.
{
"KeyPersons": [{
"Person": {
"KeyPersonType": "D",
"Forename": "user502",
"Surname": "C",
"DateOfBirth": "1995-09-14",
"Gender": "M"
}
How do I parse this JSON using datapower gateway script?
I tried the below and it didnt work.
session.input.readAsJSON(function (error, json)
if(json.KeyPersons.Person.Surname == 'C')
session.output.write(json);