Object models describe arbitrary data that can be nested inside Page Models or Data Models. Usually these models will describe page components such as header, sections, footer, etc. or common components such as buttons.

Object Models extend the common properties defined in the base Model.

Object Model Properties

In addition to the common properties, object models define the following properties:

  • labelField: the name of the field whose value will be used as an item label when the object represented by this model is used inside a list, or as field label when the object is referenced by another object.
  • extends: list of object models this object extends. The extended object will inherit from its parent all fields and their properties recursively. If the extended object already has a field with the same name as in the parent object, only the properties that resolve to undefined in the extended object will be copied.

To reference object models from within other models, use fields of type model.



  # A page model referencing the "action" object model
    type: page
    label: "Page"

      # A "button" field can reference objects represented by the "action" object model
      - type: model
        name: button
        label: Button
        models: [action]

  # The "action" object model
    type: object
    label: Action
    labelField: label
      - type: string
        name: label
        label: Label
        required: true
      - type: string
        name: url
        label: URL
        required: true

Example for generic page:

title: Home
  label: click me
  url: https://www.example.com