input payload validation in OPA for a message based OPA App.
Summary:
Validate array-based input payload
Content (please ensure you mask any confidential information):
I have a message based OPA app which has an array for approvers. I'm passing this to a sub-process with multiple instances. Before the sub-process, I want to make sure input payload has a valid array for approvers either one approver or more using exclusive gateway. something like this along with some more JSON elements
"approvers": [
{
"approver": "123456",
"approverName": "John McEnroe"
},
{
"approver": "234567",
"approverName": "Roger Federer"
}
]
In the conditional branch,I tried inputData.approvers.length()>0 and inputData.approvers[1].approver!=null and none of this is working. I checked the documentation below and it says I should be able to use these.