Complex Data Type Return Types in Operations¶
Actions¶
OData actions can have complex typed return types. However, primitive arrays are not supported in complex return types.
When returning a complex data type from an operation (function or action), arrays of primitive and enumeration types are not supported inside the complex return type in any level. However, arrays of complex types are supported.
Examples¶
Supported¶
{
"RootAlpha": "Alpha1",
"RootBoolean": true,
"RootDate": "2018-10-01",
"Children": [
{
"Level1Integer": 1,
"Level1Enum": "Car",
"Child": {
"Level2Number": 1.95,
"Level2Text": "Text1"
}
},
{
"Level1Integer": 3,
"Level1Enum": "Suv",
"Child": {
"Level2Number": 3.69,
"Level2Text": "Text2"
}
}
]
}
Marble Code¶
Not Supported¶
{
"RootAlpha": "Alpha1",
"RootBoolean": true,
"RootDate": "2018-10-01",
"RootNumArray": [ 1, 20, 24, 45 ],
"RootTextArray": [ "Text1", "Text2", "Text3" ]
}
Marble Code¶
Functions¶
OData functions only support single level complex structures. That is, functions cannot have complex return type where it has attributes of arrays or complex data types.
Examples¶
Supported¶
{
"RootAlpha": "Alpha1",
"RootBoolean": true,
"RootDate": "2018-10-01",
}
Marble Code¶
Not Supported¶
{
"RootAlpha": "Alpha1",
"RootBoolean": true,
"RootDate": "2018-10-01",
"Children": [
{
"Level1Integer": 1,
"Level1Enum": "Car",
"Child": {
"Level2Number": 1.95,
"Level2Text": "Text1"
}
}
]
}