Freigeben über


2.2.6.3.3.2 Entity Type (as a Verbose JSON Object) with Functions

Applies to the OData 3.0 protocol

In the OData 3.0 protocol, the function's name/value pair MAY be included. The value is a JSON object which contains name/value pairs of each function the server advertises as bindable to the entity.

For each function, the name MUST be the function metadata URL (section 2.2.1.4.1) that identifies the function and the value MUST be an array of JSON objects. Any number of JSON objects is allowed in this array. Each object in this array MUST have a least two name/value pairs: title and target. The order of these name/value pairs is insignificant.

The target name/value pair MUST be included and MUST contain a URL. When a client issues an Invoke Function request (section 2.2.7.5.2), this is the URL to use. The binding parameter is assumed to be bound to the encompassing entity. Therefore, if the client invokes the function via the target URL, it MUST not include a value for the binding parameter by appending a parameter to the target URL.

The title name/value pair MUST be included and MUST contain a simple string that is used as a simple but not necessarily unique name for the function. Generally, servers SHOULD specify a value that would be easily understood by any user because the title is likely to be used by clients to display options to an end user.

The function metadata URL MUST only identify functions that are bindable to the current EntityType. If overloads exist that cannot be bound to the current EntityType, individual m:Function elements SHOULD be returned that each have a function metadata URL that identifies a specific bindable overload.

If a function to be advertised has overloads that can all be bound to the current EntityType, the server SHOULD expose a single function that contains a name equal to the function metadata URL that identifies all the overloads.

Functions can also be selectively requested or omitted by using different Select system query option (section 2.2.3.6.1.11) combinations.

If the EntityType JSON Object is retrieved as part of a Feed (see section 2.2.6.2.1) and it is expensive to identify whether a function that is requested explicitly by using a Select system query option (section 2.2.3.6.1.11) is available, a server SHOULD advertise the requested function and fail later if the function is invoked and found to be unavailable.