- Issue created by @malcomio
- last update
almost 2 years ago 454 pass, 1 fail - @malcomio opened merge request.
- Status changed to Needs review
almost 2 years ago 8:44am 25 May 2023
See 💬 JSON array with single item - Unique plugin expects an array Active - cannot move that issue to the Tamper issue queue
Not sure if this is a bug or a support request.
When mapping JSON from a series of items, if the source array has a single item, the input is a string for that item.
The Unique tamper plugin throws an exception in this case.
However, the other items in the series (where the source has multiple items) are arrays.
So if we try to add the Explode plugin, that throws an exception.
1. Set up a feed to import from a source with a series of JSON arrays, where some arrays have only one item
2. Map the array and add the Unique tamper plugin
For example, I'm importing from https://data.nationalgrideso.com/api/3/action/current_package_list_with_..., and mapping resources..format
tbc - for my use case, returning the input data instead of throwing an exception seems to work.
Need to consider other scenarios - it may be better to look at the way the JSON is processed, so that the value would always be an array.
Needs review
1.0
Code