Skip to main content

Field Metadata of an API

In the sub-element cms of fields of an API, metadata for the respective field is stored. In the earlier example for the String data type, for example "column": true meant that the field is displayed in the list view in the CMS frontend:

{
"application": "Tutorial",
"label": "API1 / String",
"project": "NeuroomNet-CMS Tutorial",

"fields": {
"name": {
"type": "string",
"empty": false,
"max": 40,
"min": 4,
"optional": false,
"cms": {
"column": true
}
}
}
}

In total, the following possible settings exist:

  • column is set for fields that should appear in the list
  • sortable allows sorting by the values of the field
  • ascending is (only) then the preferred sort order
  • fulltext considers the field in a full-text search
  • unique requires that the field is unique — can possibly only be checked on the server
  • index creates a database index (ascending or descending) to speed up search
  • useCase distinguishes between upper and lower case
  • label the display name of the field in the CMS frontend

Of course, the imagination is not initially limited here, but the CMS should ultimately remain simple and limiting to the essentials makes sense — in this spirit, the listed settings are the required minimum based on typical experience.

column is a pure hint for the CMS frontend. Further layout settings for the data editing dialog could also be imagined here. Currently, all fields are simply offered for input one below the other in the order of the API configuration.