DIY Exercise 9-1 - Use Validators To Validate Response Schemas
DIY Exercise 9-1 - Use Validators To Validate Response Schemas
Objectives
In this exercise, you control message flow using validators. You will:
• Validate REST response schemas.
• Validate SOAP response schemas.
• Retrieve data concurrently.
• Filter retrieved data.
Scenario
You are tasked with adding some new functionality to an existing project that involves retrieving
data from different sources concurrently. The new requirement is to validate the responses
returned from each individual data source and filter the final payload if the payload does meet
certain criteria.
For the JSON schema file, change a key name in the required array value:
"required": ["salesID-BAD","id","firstName", …]
After you verify the validation fails for accounts and flights, change the schemas back to the
correct schemas.
Combine data
In the same Choice router, add another branch to return the flights and accounts data as a new
JSON data structure to the client if flights and accounts are not empty.
Here is what the new JSON data structure should look like:
{
accounts: {
attributes: { … },
payload: { … }
},
flights: {
attributes: { … },
payload: { … }
}