lib/schema/moboGlobalAdditions.schema.yaml

Summary

Maintainability
Test Coverage
---
properties:

####################################################
# JSON Schema annotations                          #
####################################################

  $schema:
    internal: true

  id:
    format:
    internal: true
    specific: domain
    description: |
      Usually auto generated ID, identical to the filename.

  title:
    specific: domain
    important: true
    description: |
      Human readable title.
    example:
      - |
        title: Some title

  description:
    specific: domain
    important: true
    description: |
      General Description. Fields may use them as tooltips, forms can display a small description box.
      This depends on the used template.
    example:
      - |
        description: |
          Longer description of the current model part.

  type:
    type:
      - string
    enum:
      - string
      - number
      - boolean
      - array
      - object
    important: true
    description: |
      Defines the data-type.
    example:
      - |
        type: number

  properties:
    internal: true
    description: |
      Mobo Schema does not use 'properties', it prefers 'items' since the order of the element must be garantueed.
      Internally, properties are still because of their easier accessing.

  items:
    type:
      - array
      - object
    important: true

  required:
    type:
      - array
    appliesNot:
      - field
      - form
    description: |
      Array containing the IDs of all required fields.
    example:
      - |
        required:
          - fieldA
          - fieldB

  default:
    appliesNot:
      - model
      - form
    description: |
      The default value. Applies only to fields.

  enum:
    appliesNot:
      - model
      - form
    description: |
      List of all possible values.<br>
      Defaults to a dropdown widget.
    example:
      - |
        type: string
        enum:
          - red
          - green
          - blue

  pattern:
    unsupported: true
    appliesNot:
      - model
      - form
    description: |
      Provides a Regular Expression (Regex) pattern to validate the field value.<br>
      This is currently not supported by Semantic Forms.
    example:
      - |
        pattern: '/^[\d]{4,5}/$'

  maxItems:
    type: number
    unsupported: true
    appliesNot:
      - model
      - form
    description: |
      How many instances are allowed at most.

  minItems:
    type: number
    unsupported: true
    appliesNot:
      - model
      - form
    description: |
      How many instances are required at least.

  maximum:
    type: number
    unsupported: true
    appliesNot:
      - model
      - form
    description: |
      The maximum value of a number.

  minimum:
    type: number
    unsupported: true
    appliesNot:
      - model
      - form
    description: |
      The minimum value of a number.

  maxLength:
    type: number
    unsupported: true
    appliesNot:
      - model
      - form
    description: |
      The maximum length of a string.

  minLength:
    type: number
    unsupported: true
    appliesNot:
      - model
      - form
    description: |
      The minimum length of a string.


####################################################
# Intermediary System Properties                   #
####################################################

  $extend:
    type:
    - string
    - array
    pattern: "^/.*/_*.*$"
    uniqueItems: true
    important: true
    specific: intermediary
    description: |
      This includes and extends another file of the development.<br>
      Inheritance is applied, the children (the current file) overwrites the parent properties.
    example:
      - |
        # Inherit a single parent
        $extend: /model/_Shape
      - |
        # Multiple parents are possible
        $extend:
          - /field/fieldA
          - /field/fieldB
      - |
        # extend is also used to import fields into models or models into forms.
        title: A Model with two fields
        items:
          - $extend: /field/fieldA
          - $extend: /field/fieldB

  $remove:
    type: array
    minItems: 1
    uniqueItems: true
    specific: intermediary
    description: |
      Array, containing the IDs of all items/properties to remove from current object.
    example:
      - |
        $remove:
          - fieldA
          - fieldB

  $ignore:
    type: boolean
    default: false
    specific: intermediary
    description: |
      If true, this file will be ignored completely.<br>
      Use this to temporarily remove parts of the development model without deleting them.
    example:
      - |
        $ignore: true

  $abstract:
    type: boolean
    default: false
    important: true
    specific: intermediary
    description: |
      If true this object is only used for inheritance and will not be created by itself.
    example:
      - |
        $abstract: true

####################################################
# Metadata (for internal use only)                 #
####################################################

  $reference:
    type: object
    minItems: 1
    uniqueItems: true
    internal: true
    specific: metadata
    description: |
      For internal use only!
      After inheritance is applied, $extend will be replaced through $reference.
      (For keeping info on the heritage)

  $path:
    type: string
    internal: true
    specific: metadata
    description: |
      For internal use only!
      This stores the path of the object, as used '$extend' or 'format'.
      Used for improved debugging messages

  $filepath:
    type: string
    internal: true
    specific: metadata
    description: |
      For internal use only!
      This stores the complete relative path of the development model file.
      Used for improved debugging messages

  $modelPart:
    type: string
    internal: true
    specific: metadata
    description: |
      For internal use only!
      This declares the part from the model where object originated (field, form,...)


####################################################
# Global Mobo Schema Properties                    #
####################################################

  itemsOrder:
    type: array
    items:
      type: string
    minItems: 1
    uniqueItems: true
    specific: domain
    important: true
    description: |
      In case that fields have been inherited, they might not end up in the correct order.<br>
      The itemsOrder array lists the order of the fields.
      Every field that is not listed will be appended at the bottom, in their regular order.
    example:
      - |
        itemsOrder:
          - brand
          - modelName
      - |
        itemsOrder:
          - '@unique'
          - '@sorted'
          - b
          - c
          - a
          - b

  todo:
    type: string
    specific: domain
    description: |
      If TODO notes are placed here, mobo can print them in the CLI (If the corresponding global setting is enabled).

  wikitext:
    type: string
    internal: true
    specific: metadata
    description: |
      For internal use only! This contains wikitext to inject.