I want to check if mandatory field not provided in Request Data JSON. Secondly want to check if supporting JSON object is not provided for CustomerType.
Here is my JSON that I want to validate.
{
"Transaction": {
"TrType": "Vehicle", -- This is mandatory field
"CustomerType": "Individual", -- This is mandatory field and depend upon Customer type user must have to pass IndividualClient or CompanyClient
},
"IndividualClient": {
"FirstName": "Test First Name", -- Optional field
"LName": "Test Last Name", -- Mandatory field
},
"CompanyClient": {
"CompanyName": "Company Name", -- mandatory field
}
}
How can i achieve this by using JSR223 Assertion?