Consumed REST Service – Mixed Type Array

0
Hi all – I need to consume a third party REST Service which unfortunately returns a Mixed Type JSON Array. These mixed type arrays are not supported by Mendix (https://docs.mendix.com/refguide/json-structures#2-2-json-arrays) so I’m reaching out to see if anyone has either handled these before or has any advice on how to do so. An extract from the service response: "data": { "item": { "itemid": "223911", "column": [ { "sequence": "1", "attributecolumnid": "73958", "displaydata": { "value": "Lot 1" }, "rawdata": { "value": "Lot 1" } }, { "sequence": "2", "attributecolumnid": "73959", "displaydata": { "choices": { "choice": { "style": "#000000", "label": "Market Launch" } } }, "rawdata": { "choices": { "choice": { "style": "#000000", "label": "Market Launch" } } } }, Thanks very much!  
asked
1 answers
0

Mendix can’t handle that. See this sensible idea https://forum.mendix.com/link/ideas/808 which was closed shortly after being created and receiving quite some upvotes in no-time.

Workaround: Do the export mapping in three steps, first for the sequence-elements, the for the raw-data elements, then for the data elements in which you add a placeholder-text like “herecomesthecomplextype”. Postprocess the last mapping result containing the data and replace “herecomesthecomplextype” with the other two export mapping results.

answered