Forum Discussion
harishlean
5 years agoNew Contributor
Hi Riche,
Thank You for the reply. I have provided a sample response below.
{
"product":"book",
"product":"book",
"title":"atomic habits"
}
Since the attribute "product" is repeated twice, I am getting the mentioned error. It would be great if it can be handled via event handler. I just want to capture the value of "title"
Get Outlook for Android
Thank You for the reply. I have provided a sample response below.
{
"product":"book",
"product":"book",
"title":"atomic habits"
}
Since the attribute "product" is repeated twice, I am getting the mentioned error. It would be great if it can be handled via event handler. I just want to capture the value of "title"
Get Outlook for Android
nmrao
5 years agoCommunity Hero
You need to first check with your development team or service provider and let them address the issue.
- richie5 years agoCommunity Hero
Hey harishlean
ok - so your json is actually malformed. This is definitely a defect and as nmrao said, you will need raising with your developers.
As I said previously - it is possible to alter your response before you get the chance to assert/property transfer using an event handler, but due to the fact you have a duplicate, you cant use jsonpath to identify and remove the erroneous info and so this is beyond my groovy skills - I only know the basic stuff that Rao's taught me!
One of the groovy experts on here might be able to help - but I kinda think you'd be wasting your time as the payload is defective.
Makes more sense to get the payload fixed first.
Cheers,
Rich
- sonya_m5 years ago
Alumni