title: How to validate elements in nested json array in karate?
body: <p>I am using the karate framework for writing some automated test cases. I'd like to validate the schema for each element in a nested array list . For the example below, I would like to validate each child of each element in the returned array. Is there a way to get an array list of all children of all elements? I can do that by calling some java functions, but I was wondering if there's a way in karate to get that.</p>
  
  <p>Something like "for each element in the returned array validate the schema of each of its children".</p>
  
  <p>Thanks!</p>
  
  <pre><code>[
      {
          "id": "A",
          "children": [
              {
                  "size": "10",
                  "type": "A",                   
                  "name": "B"
              },
              {
                  "size": "10",
                  "type": "A",                   
                  "name": "B"
              }                            
          ]
      },
      {
          "id": "B",
          "children": [
              {
                  "size": "10",
                  "type": "A",                   
                  "name": "B"
              }, 
              }
                  "size": "3",
                  "type": "C",                   
                  "name": "D"
              }               
          ]
      }
  ]
  </code></pre>