24 DOMAIN TYPE COLLECTION DESCRIPTION RESOURCE

The domain collection description resource represents a description of a domain collection, within the metamodel.

Clients can use the domain collection description’s representation as hints when building a UI. For example, there will be links back to the domain type representing the collection’s element type; this can be used by a client to determine columns for a table view. Or, the client can use information in the representation in order to apply client-side validation of declarative semantics (for example, minimum or maximum cardinality of a collection).

The endpoint URL for this resource is:

/domain-types/{domainType}/collections/{collectionId}

where:

  • {domainType} is either

    • the domain type id, or

    • is a built-in JSON type

  • {collectionId} identifies the collection.

24.1 HTTP GET

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

24.1.1 GET Request

24.1.1.1 Query String

  • none

24.1.1.2 Headers

  • Accept

    • application/json

    • application/json;profile=… /collection-description

24.1.1.3 Body

  • N/A

24.1.2 Successful Response

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

24.2 Representation

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

Slide14
Figure 1. DOMAIN COLLECTION DESCRIPTION REPRESENTATION

The JSON returned representation (for the Order’s items collection) might look something like:

{
  "id": "items",
  "friendlyName": "items",
  "plural form": "Order items",
  "description": "Line items (details) of the order",
  "memberOrder": 3,
  "links": [ {
      "rel": "self", ...
    }, {
      "rel": "up",
      "href": "http://~/domain-types/ORD",
      "type": "application/json;profile=\".../domain-type\"",
      "method": "GET"
    }, {
      "rel": ".../returntype",
      "href": "http://~/domain-types/list",
      "type": "application/json;profile=\".../domain-type\"",
      "method": "GET"
    }, {
      "rel": ".../elementtype",
      "href": "http://~/domain-types/ORI",
      "type": "application/json;profile=\".../domain-type\"",
      "method": "GET"
    }, {
      "rel": "help",
      "href": "http://~/videos/training/Order-items-explained.mpg",
      "type": "audio/mpeg",
      "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 collection friendlyName the collection name, formatted for rendering in a UI.

pluralForm

the pluralized form of the element type within the collection/list.

description

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

memberOrder

a presentation hint as to the relative order to display each member

links[rel=up]

link to the domain type which owns this property

links[rel=…​/return-type]

link to the domain type for list or for set.

links[rel=…​/element-type]

link to the domain type of the objects contained in the collection

links[rel=help]

(optional) link to a media resource providing help about the property

extensions

additional information about the resource.

"extensions"

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