Export and Import mapping with recursive JSON structure

2
I have below JSON schema which has recursive structure and I want to create export and import mapping using this structure. Any idea how I can implement this. {     "Objects": [         "Node": {             {                 "type": "object",                 "properties": [                     {                         "Name":"",                         "Values":[""]                     }                 ],                                     "children": [                     "$ref": "#/Objects/Node"                 ]             }         }     ] }
asked
4 answers
0

Related to this question:
https://forum.mendix.com/link/questions/87475

answered
0

I believe all you need to do is right-click one of your folders, choose Add other, JSON structure, paste in your JSON and click OK.  Then right-click the same folder, choose Add other, Export Mapping and then you can use the JSON structure.

answered
0

TLDR; You can't map a recursive structure in JSON. But you could use an example message with an amount of levels (10?) that is higher then you will ever enounter.

The problem with recursive structures is that in theory they are infinitely long which makes it hard to map them graphically. Unless your mapping would be some kind of template. But this is not the case in Mendix.

In Mendix you have to map every level specifially, which basically means that your structure cannot be infinitly deep. More so because you use an example message as message definition when you use a JSON message. If you use an XML/SOAP Message you could use an XSD which allows you to import the infinite structure but you still need to map each level explicitly.

answered
-1

Hope the below links helps.

https://docs.mendix.com/refguide/import-mappings

https://docs.mendix.com/refguide/import-mapping-action

https://docs.mendix.com/refguide/export-mappings

answered