Invoking Functions with Complex Data Type Parameter

In OData functions, parameter aliases need to be used to represent structure type parameter values. The value for the alias must be specified as a separate query option using the name of the parameter alias.

Parameter Aliases

Parameter aliases MUST start with an @ character, and its value MUST be specified either as a URL literal (for primitive values) or as a JSON formatted OData object (for complex values, or collections of primitive or complex values).

For more details about parameter aliases, please follow the links below.

Example

Following requests are for the FunctionStructBindTestUb function which has the RootStruct structure parameter.

With All Attributes

http[s]://{host}:{port}/{main|b2b}/ifsapplications/projection/v1/Operations.svc/FunctionStructBindTestUb(StructPara=@Alias1)?@Alias1={ "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" } } ] }

With Some Attributes

http[s]://{host}:{port}/{main|b2b}/ifsapplications/projection/v1/Operations.svc/FunctionStructBindTestUb(StructPara=@Alias1)?@Alias1={ "RootAlpha": "Alpha1", "RootDate": "2018-10-01", "Children": [ { "Level1Integer": 1, "Level1Enum": "Car", "Child": { "Level2Number": 1.95 } }, { "Level1Integer": 3, "Level1Enum": "Suv" } ] }

Marble code for the above function and Complex type

Function

function FunctionStructBindTestUb Text {
    parameter StructPara Structure(RootStruct);
}

Example code - Marble function

Structures

structure RootStruct {
    attribute RootAlpha Alpha;
    attribute RootDate Date;
    attribute Children List<Structure(Level1Struct)>;
}

structure Level1Struct { attribute Level1Integer Integer; attribute Level1Enum Enumeration(VehicleType); attribute Child Structure(Level2Struct); }
structure Level2Struct { attribute Level2Number Number; attribute Level2Text Text; }

Example code - Marble structure

Back