Forum Discussion
anubhav_nautiya
6 years agoContributor
why are you using a copy snap to validate JSON? Copy will just simply give you multiple outputs, feed you input from postman to a JSON generator and it should fail validating the JSON.
- KumarR6 years agoNew Contributor
Hi Anubhav,
Thanks for looking in this! I gave example of copy snap to show that it removes dup keys in invalid json.
As per your suggestion i tried using Json generator by having i/p view and template to snap as below-[
{
“www” : $www
}
]
But Json generator also has removed dup key and provided output. I want this to be failed as i supplied invalid json from psotman. $www has dup key inside it as ‘station’- anubhav_nautiya6 years agoContributor
Hi,
Can you try JSON.parse() function in a mapper and give it a try.