JSON with id will not be imported in model

0
Here our JSON structure to import: { "relation": { "id": { "relation_number": "string", "relation_type": "string", "company_name": "string", "payment_condition_id": "string" } } }  add this to json structure and created and import mapping The response is: { "relation": { "1178": { "relation_number": "1", "relation_type": "lead", "company_name": "company abc", "payment_condition_id": "9" }, "1179": { "relation_number": "67", "relation_type": "prospect", "company_name": "company xyz", "payment_condition_id": "7" } } } } in the console I saw the following mapping elements: Available mapping elements: (Object) maps to object 'MyRest.Root' (Object)|relation maps to object 'MyRest.relation' (Object)|relation|id maps to object 'MyRest._id' (Object)|relation|id|payment_condition_id maps to member 'Payment_condition_id' (Object)|relation|id|company_name maps to member 'Company_name' (Object)|relation|id|relation_number maps to member 'Relation_number' Our model is: Entity Root Association Relation_Root 1:n Entity relation Association _ids   1:n Entity _id with the attributes Via Microflow I get response as import_mapping. Via debugger Root is available, relation is available but _id is not available. In console is also visible:  - Added to path: 'company_name'. Current path: '(Object)|relation|1178|company_name'  Any suggestion how to solve this?
asked
1 answers
1

Hi,

it possible to change your structure so that it the id is an primitive value instead:

e.g. 

{
    "relation": [
      { "id": "1178",
        "relation_number": "1",
        "relation_type": "lead",
        "company_name": "company abc",
        "payment_condition_id": "9" },
      { "id": "1179",
        "relation_number": "67",
        "relation_type": "prospect",
        "company_name": "company xyz",
        "payment_condition_id": "7" }				
    ]
}

I believe, this you could much more easily parse with Mendix.

-Andrej

answered