run checks over a list of JSON


I have a requirement where after a query to an API it returns a list of JSON objects. I wish to run various checks over each of these objects. I am having trouble, traversing over a list and applying these checks.
This is what I have so far.


val v3Scenario = scenario(generateNewScenario)
).foreach("${resultList}", “result”) {
.check(???) //etc.


And of course it doesn’t compile, but I wonder if there is something similar I can do get what I want

any help is appreciated.



nevermind, I think I found a way around.
I decided to use transformOpt, and within that I am returning validation with success and failures.

Yeah, that’s probably the easiest way atm.