23 DOMAIN TYPE PROPERTY DESCRIPTION RESOURCE

The domain property description resource describes a property of a domain type within the metamodel.

Clients can use the domain property description’s representation as hints when building a UI. For example, there will be links back to a domain type representing the property type; this can be used to select the relevant widget for that property. Or, the client can use information in the representation to apply client-side validation of declarative semantics (for example, mandatory properties, or regex patterns).

The endpoint URL for this resource is:

/domain-types/{domainType}/properties/{propertyId}

where:

  • {domainType} is either

    • the domain type id, or

    • is a built-in JSON type

  • {propertyId} identifies the property.

23.1 HTTP GET

Obtain a representation that describes a domain property within the metamodel.

23.1.1 GET Request

23.1.1.1 Query String

  • none

23.1.1.2 Headers

  • Accept

    • application/json

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

23.1.1.3 Body

  • N/A

23.1.2 Successful Response

As per §D20.1 (200); body as per §D23.2.

23.2 Representation

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

Slide13
Figure 1. DOMAIN PROPERTY COLLECTION REPRESENTATION

The JSON representation (for the Order's deliveryTime property) looks something like:

{
  "id": "deliveryTime",
  "friendlyName": "Delivery Time",
  "description": "Time that the order will be delivered",
  "optional": false,
  "format": ... (1)
  "maxLength": ... (1)
  "pattern": ... (1)
  "memberOrder": 1,
  "links": [ {
      "rel": "self", ...
    }, {
      "rel": "up",
      "href": "http://~/domain-types/ORD",
      "type": "application/json;profile=\".../domain-type\"",
      "method": "GET"
    }, {
      "rel": ".../returntype",
      "href": "http://~/domain-types/string",
      "type": "application/json;profile=\".../domain-type\"",
      "method": "GET"
    }, ...
  ],
  "extensions": { ... }
}
1 for string properties only

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 property friendlyName the property name, formatted for rendering in a UI.

description

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

optional

indicates whether the property is optional maxLength for string properties, indicates the maximum allowable length. A value of 0 means unlimited.

pattern

for string properties, indicates a regular expression for the property to match.

memberOrder

a presentation hint recommending the relative order to display each member (clients are not obliged to follow this).

format

for properties returning a string or number value, indicates how to interpret that value §A2.5.

links[rel=up]

link to the domain type which owns this property

links[rel=…/return-type]

link to the domain type of which this property holds a value (ie, its return type)

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/ json-properties to "links" and "extensions" as they require. One possible example is to specify which properties should appear as table columns when the domain type in question is the element type of a collection or list being rendered as such.