Forum Discussion

KumarR's avatar
KumarR
New Contributor
6 years ago

How to fail a Snap for Invalid json as i/p doc(Duplicate keys)

Hi Team,
I am sending a invalid json payload from the postman to my pipeline.
The pipeline has first snap as Copy, when i checked the output of copy it has removed duplicated keys from the invalid json payload. My expectation was that it will throw error as i have sent invalid json.
Any thought on how can i fail the pipeline if the payload coming as invalid json into pipeline/snap?
Below was payload i sent to pipe from postman tool-
{
“www”: {
“station”: “3333”,
“station”: “22222”,
“station”: “44444”,
“dd”: 24224,
“dd1”: “34224”,
“dd2”: “sfsf”,
“dd3”: “dddsfsf”
}
}

The output of copy snap came as below(i wannt the snap to be failed as it was invalid json data)-
{
“www”: {
“station”: “44444”,
“scaleId”: “wrwr”,
“dd”: 24224,
“dd1”: “34224”,
“dd2”: “sfsf”,
“dd3”: “dddsfsf”
}
}

Thanks,
Kumar R

7 Replies

  • yes1819's avatar
    yes1819
    New Contributor III

    Hi, sorry for the delay in response.

    I do pass the version to the last snap

     

    • Aleksandar_A's avatar
      Aleksandar_A
      Contributor III

      Hello,

      The CSV Formatter by default only passes the binary content and the content type. If you want to pass other key - values, you can by adding Binary Header Properties.

      Please refer to the official CSV Formatter documentation.

      CSV Formatter Docs 

      Please let me know if this helps you.

      Regards,

      Aleksandar.