I don't the how-to approach to this problem, I have a payload JSON which is mapped to the model class and I need to validate that if a key is present or its value is null if so return the missing key or null key in the response.
eg JSON
{
"serviceID": "Xyz",
"billingPIN": "abc",
"customerAccountName": "sam",
}
Example json with missing key:
{
"serviceID": "Xyz",
"billingPIN": "abc", <---- Customer is missing.
}
** Need to construct the response: **
{
"missingkey":"customerAccountName"
}
Any help will be appreciated