title: mule4 dataweave 2.0 write csv file with only headers
body: <p>In dataweave2.0 if payload is empty it should print only headers with pipe seperated. i have tried below code:</p>
  
  <pre><code>%dw 2.0
  output application/csv separator='|', header=true
  ---
  [{
        field1: "",
        field1: ""
  
  }]
  
  Output:
  field1|field2|field3
  |||
  
  Desired output is only headers:
  field1|field2|field3
  
  Please guide
  </code></pre>