sprice090161
7 years agoContributor
How to validate multiple sets of output data within a single response?
My application request returns 1 to many datasets to the user in a single response. For example the user requests a loan, and the response will contain a structure for each supported loan offing in the sql db. Since I configure the DB with the supported offer(s), I will always know how many are supported and thus how many responses to expect. I could simply start writing validation expecting a known quantity of nodes in the output, and then create sets of redundant assertions 1 per expected offer in the response.
Is there a smarter way combining DB queries to to get counts and data, with assertions at the request output that would validate each child with in each set?