14
With EDM types, it was possible to receive requests with nested JSON structures and accessing the whole structure from the same API page.

Since EDM types have been removed, this flexibility is not possible anymore. The only workaround found is to pass an escaped JSON object as part of the message, to be translated into text.

Example with EDM:
{
"headerfield":"headervalue"
"lines": [{
"linefield":"linevalue1"
}]
}

Example with escaped JSON field, without using an EDM Type:
{
"headerfield":"headervalue"
"lines": "[{\"linefield\":\"linevalue1\"}]"
}

The two examples above would both produce a text variable for the 'lines' field, that can be accessed through the header API page, which is the required flexibility. This cannot be achieved using parts within one request.

A simple suggestion would be to create a property in the field (e.g. SubType = JSON), which would enable a nested JSON object or array to be translated into a text variable.

Example:
field(lines; LinesJson)
{
Caption = 'lines', Locked = true;
SubType = 'JSON';
}
...
var
LinesJson: Text;

Another solution would be to allow complex data types in API / Web Services requests.

This solution must work on both On-Prem and SaaS version.
Category: Development
STATUS DETAILS
Needs Votes