I have following JSON structure
{
"customFields": {
"paymentMethods": [
{
"tokenizedCard": "11223",
"cardNumber": "XXXXXX001"
},
{
"tokenizedCard": "12345",
"cardNumber": "XXXXX678"
}
]
},
"paymentDetails": {
"method": [
{
"paymentType": "CREDIT_CARD",
"tokenizedCard": "11223"
},
{
"paymentType": "UPI",
"tokenizedCard": "12345"
}
]
}
}
I want to validate this JSON with following condition.
If paymentDetails.method.paymentType = CREDIT_CARD then
compare tokenizedCard from same object with the tokenizedCard of customFields.paymentMethods and if matches then make cardNumber required from that object of customFields.paymentMethods.
I tried using $ref & $definition and but I was not able to make that happen.
Any help with the required schema would be appreciated!
Note: I am doing schema validation in azure logic app.