Make workflow page API to accept an unnamed object or a list of objects

REST APIs normally have the main (one) object in the body JSON.

In Origam, we have ROOT entity on JSON top level all the time. So e.g. the following is valid for Origam.

{
    "Product" : {
        "SKU" : "123"
        "Name" : "salt"
    }
}

Origam also accepts an array of products ( ..."Product" : [{ ...

Whereas normally in REST, it would be the following way (could be also enclosed in [] when it’s an array.

{
    "SKU" : "123"
    "Name" : "salt"
}

So I would implement that behaviour the following way:
The workflow page body parameter mapping would have one more field called:

DataStructureEntity (optional)

Datastructure entity would be selectable from the list of top level entities of a datastructure of the target contextstore of the mapping.

If filled, it would try to map the input json to that entity.

That change would make possible to model REST APIs usual way.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.