title: curl json object as POST data from json array file using jq in a loop
body: <p>Here is my sample test.json file</p>
  
  <pre><code>[
      {
          "description": "Some description",
          "name": "Some name",
          "summary": "Some summary. "
      },
      {
          "description": "Some description",
          "name": "Some name",
          "summary": "Some summary. "
      },
      {
          "description": "Some description",
          "name": "Some name",
          "summary": "Some summary. "
      }
  ]
  </code></pre>
  
  <p>Here is the bash script</p>
  
  <pre><code>declare -A values=( )
  while IFS= read -r value; do
    echo "Read  $value" &gt;&amp;2
    #echo $value | curl -d @- -H "Content-Type: application/json" https://example.com/api/foo
  done &lt; &lt;(jq -r '.[]' &lt;$1)
  </code></pre>
  
  <p>This is the output that I get</p>
  
  <pre><code>Read {
  Read    "description": "Some description",
  Read    "name": "Some name",
  Read    "summary": "Some summary. "
  Read }
  Read {
  Read    "description": "Some description",
  Read    "name": "Some name",
  Read    "summary": "Some summary. "
  Read }
  Read {
  Read    "description": "Some description",
  Read    "name": "Some name",
  Read    "summary": "Some summary. "
  Read }
  </code></pre>
  
  <p>I want to use the JSON objects in the file, to POST data to an API using curl.  I would expect the loop to run three times.</p>
  
  <p>How do I get entire JSON object (resulting in the loop running 3 times) instead of outputting every single line from the test.json file? </p>