Skip to content

Collection Data Type Support for Operations (Arrays)

OData Operations supports collection type parameters and return types in operations.

Both primitive and complex data type arrays are supported as parameters. But it should note that when it comes to return types, the same limitation mentioned in Complex return type applies here as well. (See the Complex type return limitation)

Limitation

This limitation occurs when the return type of the operation is an array of complex type. In this case, you cannot have arrays of primitive type inside structures. Also if a function have a return type of complex data type, then it can only have primitive attributes only. (complex or collection type attributes are not supported)

Supported Return types

For Actions

{  
    "@odata.context": "http://{host}:{port}/ifsapp/ActionTest.svc/$metadata#Collection(IfsApp.ActionTest.ComplexStruct)",  
    "value": [  
        {  
            "AlphaAttribute": "Alpha1",  
            "BooleanAttribute": true,  
            "RootStructCollection": []  
        },  
        {  
            "AlphaAttribute": "Alpha2",  
            "BooleanAttribute": null,  
            "RootStructCollection": [  
                {  
                    "RootAlpha": "Alpha2",  
                    "RootDate": null,  
                    "Child": {  
                        "Level1Integer": 2,  
                        "Level1Enum": null  
                    }  
                }  
            ]  
        }  
    ]  
}  

Marble Code

Valid Structure Valid Structure

For Functions

{  
    "@odata.context": "http://{host}:{port}/ifsapp/ActionTest.svc/$metadata#Collection(IfsApp.ActionTest.ComplexStruct)",  
    "value": [  
        {  
            "AlphaAttribute": "Alpha1",  
            "BooleanAttribute": true,  
            "EnumAttribute": "Industry",  
            "IntegerAttribute": 2,  
            "NumberAttribute": 5.9  
        },  
        {  
            "AlphaAttribute": "Alpha2",  
            "BooleanAttribute": null,  
            "EnumAttribute": "Industry",  
            "IntegerAttribute": 7,  
            "NumberAttribute": 6.22  
        }  
    ]  
}  

Marble Code

Valid Structure Valid Structure

Not Supported Return types

For Actions

{  
    "@odata.context": "http://{host}:{port}/ifsapp/ActionTest.svc/$metadata#Collection(IfsApp.ActionTest.ComplexStruct)",  
    "value": [  
        {  
            "AlphaAttribute": "Alpha1",  
            "BooleanAttribute": true,  
            "RootStructCollection": [],  
            "PrimitiveCollection": [1, 2, 3, 4]  
        },  
        {  
            "AlphaAttribute": "Alpha2",  
            "BooleanAttribute": null,  
            "RootStructCollection": [  
                {  
                    "RootAlpha": "Alpha2",  
                    "RootDate": null,  
                    "Child": {  
                        "Level1Integer": 2,  
                        "Level1Enum": null  
                    }  
                }  
            ],  
            "PrimitiveCollection": []  
        }  
    ]  
}  

Marble Code

Valid Structure

For Functions

{  
    "@odata.context": "http://{host}:{port}/ifsapp/ActionTest.svc/$metadata#Collection(IfsApp.ActionTest.ComplexStruct)",  
    "value": [  
        {  
            "AlphaAttribute": "Alpha1",  
            "BooleanAttribute": true,  
            "EnumAttribute": "Industry",  
            "IntegerAttribute": 2,  
            "NumberAttribute": 5.9,  
            "RootStructCollection": [  
                {  
                    "RootAlpha": "Alpha2",  
                    "RootDate": null,  
                    "Child": {  
                        "Level1Integer": 2,  
                        "Level1Enum": null  
                    }  
                }  
            ]  
        },  
        {  
            "AlphaAttribute": "Alpha2",  
            "BooleanAttribute": null,  
            "EnumAttribute": "Industry",  
            "IntegerAttribute": 7,  
            "NumberAttribute": 6.22,  
            "RootStructCollection": [  
                {  
                    "RootAlpha": "Alpha3",  
                    "RootDate": null  
                }  
            ]  
        }  
    ]  
}  

Marble Code

Valid Structure