title: jq: error (at <stdin>:0): Cannot iterate over null (null)
body: <p>I've been working with an API call to structure it in JSON format so I might later push it into a database. Then code looks like this:</p>
  
  <pre><code>getPage() {
  curl --fail -X GET 'https://api.app.com/v1/test?page=1&amp;pageSize=1000&amp;sort=desc' \
    -H 'Authorization: Bearer 123abc456pickupsticks789' \
    -H 'cache-control: no-cache'  
  }
  
  getPage \
  | jq -c '.items | .[] | {landing_id: .landing_id, submitted_at: .submitted_at, answers: .answers, email: .hidden.email}' \
    &gt; testpush.json
  </code></pre>
  
  <p>When I run it though, it produces this error: <code>jq: error (at &lt;stdin&gt;:0): Cannot iterate over null (null)</code></p>
  
  <p>I've looked at solutions such as <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwjTkOaaksvgAhWGT98KHeJjCSgQFjAAegQICRAB&amp;url=https%3A%2F%2Fmarkhneedham.com%2Fblog%2F2015%2F10%2F09%2Fjq-error-cannot-iterate-over-null-null%2F&amp;usg=AOvVaw3MlzRddK0KFA3kn14E8u78" rel="noreferrer">this one</a>, <a href="https://stackoverflow.com/questions/28213232/docker-error-jq-error-cannot-iterate-over-null">or this one from this site</a>, and <a href="https://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=3&amp;cad=rja&amp;uact=8&amp;ved=2ahUKEwiVstTNksvgAhUIWN8KHUukBucQFjACegQIBxAB&amp;url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F54176763%2Fgithub-actions-filter-returns-jq-error-cannot-iterate-over-null-null&amp;usg=AOvVaw2YRkgqsn5G_w4SbTSP_ZQJ" rel="noreferrer">this response.</a> </p>
  
  <p>The common solution seemed to be using a <code>?</code> in front of <code>[]</code> and I tried it in the <code>jq</code> line towards the bottom, but it still does not work. It just produces an empty json file.</p>
  
  <p>Am I misreading the takeaway from those other answers and not putting my <code>?</code> in the right place?></p>