2.2.6.2.1.3 Entity Set (as an Atom Feed Element) with Functions
Applies to the OData 3.0 protocol
In the OData 3.0 protocol, it is possible to advertise the availability of functions (section 2.2.1.4) that are bindable to the definition of the feed, in the feed.
Functions that are advertised by the server MUST be encoded in an m:function element under the atom:feed element that corresponds to the feed that the function is bound to. There can be any number of functions bound to the feed, and therefore, there can be an arbitrary number of m:function elements.
The m:function element MUST have a metadata attribute that contains the function metadata URL (section 2.2.1.4.1). The function metadata URL MUST identify only functions that are bindable to the current feed definition. If overloads exist that cannot be bound to the current feed definition, individual m:Function elements SHOULD be returned that each have a function metadata URL that identifies a specific bindable overload.
The m:function element MUST have a target attribute that contains a URL. This is the URL to which clients issue an Invoke Function request (section 2.2.7.5.2) to invoke the function. The binding parameter is assumed to be bound to the encompassing feed definition. Therefore, if the client invokes the function via the target URL, it MUST not include a value for the binding parameter in the request via a parameter appended to the target URL.
The m:function element MUST have a title attribute that contains a simple string that is used as a simple but not necessarily unique name for the function. Generally, servers SHOULD specify a title 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.
If a function to be advertised has overloads, the server SHOULD expose a single m:function element with a metadata attribute that identifies all the overloads.
Functions advertised in the Atom feed element MUST be interpreted as being bound to the definition of the feed and not to the items that are represented in the feed.
Functions that operate on a feed MUST only be advertised in an Atom feed element if the server can fully encode the function, the resource path, and the appropriate system query options that define the feed.
System query options (section 2.2.3.6.1) that change the membership of the feed MUST be considered part of the feed definition. In practice, this means that the target URL that is used to invoke the function MUST encode the following system query options if they are used to define the feed:
$orderby (section 2.2.3.6.1.6)
The remaining system query options, generally, do not define the feed and, therefore, do not need to be encoded in the target of the function:
$skiptoken (section 2.2.3.6.1.9)