Import mapping with Message Definition fails for one to many

0
I have a published REST service (POST) and use MessageDefinition for my import mapping of the incoming request. The MessageDefinition is based on an entity with a one to many association. The request json contains a one to many part to match this. When I use the MessageDefinition for the import mapping I don't get the associated objects, whereas when I use the json structure for import mapping I do get the associated objects. Why does the import mapping with MessageDefinition not give the associated objects?
asked
3 answers
0

Hi Carlo,

 

How does your incoming body look?

 

If your JSON looks something this

{
    "associatedEntities": [
            "Val1",
            "Val2"
    ]
}

You may need a helper entity between your parent (or root) entity and your associated entities. The helper entity will then be a one-to-one association with your parent and the associated entities will be a many-to-one association to the helper entity

answered
0

The domain model is like this, but that gives the result as mentioned above:

The json is as follows:

{
   "SomeAttribute" : "Value",
   "HelperObject" : [
      {
         "Attribute" : "Value"
      },

      {
         "Attribute" : "Value"
      }
   ]
}

answered
0

Solved by generating both import- and export mapping by the MessageDefinitions, based on this model: 

answered