220.127.116.11.2.2 Entity Set (as a Verbose JSON Array) with Actions
Applies to the OData 3.0 protocol
In OData 3.0, it is possible to advertise actions (section 18.104.22.168) that are bound to the definition of the feed (or EntitySet) in the feed.
A new action's name/value pair MAY be included as a property of the JSON object that is the value of the optional "__metadata" JSON object. The "__metadata" JSON object is a peer of the results name/value pair that actually holds the array of entities.
The value of the action's name/value pair is a JSON object that contains name/value pairs for each action that the server advertises as bindable to the definition of the feed.
For each action, the name MUST be the Action Metadata URL (section 22.214.171.124.1) that identifies the action 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 at 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. This is the URL to which clients issue an Invoke Action request (section 126.96.36.199.1) to invoke the action. The binding parameter is assumed to be bound to the encompassing feed definition. Therefore, if the client invokes the action via the target URL, the request body MUST not include a value for the binding parameter.
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 action. 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.
Actions advertised in the feed MUST be interpreted as being bound to the definition of the feed and not to the items that are represented in the feed.
Actions that are advertised in the feed MUST be advertised only if the server can fully encode the action, the resource path, and the appropriate system query options that define the feed.
System Query Options (section 188.8.131.52.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 action MUST encode the following system query options if they are used to define the feed:
The remaining system query options, generally, do not define the feed and do not need to be encoded in the target of the action: