25 DOMAIN TYPE ACTION DESCRIPTION RESOURCE

The domain action description resource represents an action of a domain type, within the metamodel.

Clients can use the domain action description’s representation as hints when building a UI. For example, the representation of an object action may include a link to that action’s return type.

The endpoint URL for this resource is:

/domain-types/{domainType}/actions/{actionId}

where:

  • {domainType} is either

    • the domain type id, or

    • is a built-in JSON type

  • {actionId} identifies the action.

25.1 HTTP GET

Obtain a representation of a description of a domain action, within the metamodel.

25.1.1 GET Request

25.1.1.1 Query String

  • none

25.1.1.2 Headers

  • Accept

    • application/json

    • application/json;profile="…​/action-description"

25.1.1.3 Body

  • N/A

25.1.2 Successful Response

As per §20.1 (200); body as per §25.2.

25.2 Representation

The links from the domain action description representation to other resources are as shown in the diagram below:

Slide15
Figure 1. DOMAIN ACTION DESCRIPTION REPRESENTATION

The JSON representation of the domain action description (for the Order's submit(…​) action) might look something like:

{
  "id": "submit",
  "friendlyName": "Submit",
  "description": ..., "hasParams": true,
  "memberOrder": 5,
  "links": [ {
      "rel": "self",
      ...
    }, {
      "rel": "up",
      "href": "http://~/domain-types/ORD",
      "type": "application/json;profile=\".../domain-type\"",
      "method": "GET"
    }, {
      "rel": ".../return-type",
      "href": "http://~/domain-types/x.OrderReceipt",
      "type": "application/json;profile=\".../domain-type\"",
      "method": "GET"
    }, {
      "rel": "help",
      "href": "http://~/videos/training/Order-submit.mpg",
      "type": "audio/mpeg",
      "method": "GET"
    }, ...
  ],
  "parameters": {
    "ship": {
      "rel": ".../action-param;param=\"ship\"",
      "href": "http://~/domain-types/ORD/submit/params/ship",
      "type": "application/json;profile=\".../action-param-description\"",
      "method": "GET"
    },
    "rush": {
      "rel": ".../action-param;param=\"rush\"",
      "href": "http://~/domain-types/ORD/submit/params/rush",
      "type": "application/json;profile=\".../action-param-description\"",
      "method": "GET"
    }, ...
  },
  "extensions": { ... }
}

where:

JSON-Property Description

links

list of links to other resources.

links[rel=self]

link to a resource that can obtain this representation

id

the Id of this action

friendlyName

the action name, formatted for rendering in a UI.

pluralForm

(optional) for actions returning collections the pluralized form of the element type within the collection/list.

description

a description of the action, e.g. to render as a tooltip.

hasParams

whether the action has parameters memberOrder a presentation hint as to the relative order to display each member

links[rel=up]

link to the domain type which owns this action

links[rel=…​/return-type]

link to the action’s return type

links[rel=…​/element-type]

(optional) link to the element type if the action returns a collection.

links[rel=help]

(optional) link to a media resource providing help about the action parameters map of links to parameter details §D26

extensions

map of additional information about the resource.

"extensions"

Restful Objects defines the no standard json-properties within "extensions", but implementations are free to add further links/json-properties to "links" and "extensions" as they require.