title: in Adobe CQ (AEM) how to iterate through a list of resources using `data-sly-list` and `data-sly-resource` in sightly?
body: <p>In AEM 6.1, with a structure like this:</p>
  
  <pre><code> - Page
     - form node
       - parsys
         - node 1
         - node 2
         - ...
         - node n
  </code></pre>
  
  <p>The original form has the following code which works 
  <code>&lt;div data-sly-resource="${ 'parsys' @ resourceType='foundation/components/parsys' }" data-sly-unwrap&gt;</code></p>
  
  <p>I'm trying to update the form component that injects something before the last <code>node n</code>. On the form node, I have the following code:</p>
  
  <pre><code>&lt;div data-sly-list.children="${resource.listChildren}"&gt;
      &lt;div data-sly-list.fields="${children.listChildren}"&gt;
          &lt;div data-sly-test=${fieldsList.last}&gt; DO SOMETHING BEFORE LAST NODE&lt;/div&gt;
          &lt;div data-sly-resource="${fields}"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The <code>data-sly-resource</code> seems to cause the server to hang, with very high cpu usage while the browser is waiting for response. I have to terminate the server process and restart it. </p>
  
  <p>I have tried <code>&lt;div data-sly-resource="${fields @ resourceType = fields.resourceType}"&gt;&lt;/div&gt;</code> but it doesn't seem to render the fields as expected. </p>
  
  <p>Is this the right way of iterating through nodes? </p>
  
  <hr>
  
  <p>Update: Looked in the massive error.log file, and it seems the CPU spike was caused by infinite loop of RecursionTooDeepException - which I don't see where the recursion is. </p>