cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

JSON snap not working as expected

dabalka
New Contributor II

JSON splitter last week was working correctly.
Pipeline was not edited, JSON format did not change, and yet Pipeline is crashing indicating error that JSON splitter is expecting list not an object. Before 17th of Feb it was working perfectly fine. was something changed in snap architecture?
โ€œFailure: Json Splitter expects a list, Reason: Found an object of type class java.util.LinkedHashMap, Resolution: The path $.data needs to refer to a list in the incoming documentโ€

image

1 ACCEPTED SOLUTION

The object $data is an instance of Object not an arrayโ€ฆ

Place a mapper before the JSON splitter then set mapper as pass through enabled

image

View solution in original post

16 REPLIES 16

Kindly post a screenshot of pipeline validation before the JSON splitter snap

Thanks

dabalka
New Contributor II

image

The object $data is an instance of Object not an arrayโ€ฆ

Place a mapper before the JSON splitter then set mapper as pass through enabled

image

dabalka
New Contributor II

Thanks it seems to work!
Do you know why it was working since like always, till last Thursday 16th of Feb and now it is not? Json is the same structureโ€ฆ It was going smoothly before. This is strange for me, my colleague has the very same issue with different pipeline, different json file, also there was a scheduled task last week and it went smoothly, today he has the same error messageโ€ฆ

Using jsonPath in the JSON splitter snap will do the work without the additional mapper

I Would prefer this solution ๐Ÿ˜€

jsonPath($, โ€œ$.data[*]โ€)

image

image