Schema für die Formularkonfiguration

Für die Validierung der Formularkonfiguration wird folgendes Schema verwendet.

{
  "$id": "http://bpc.virtimo.net/forms/1/schema",
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "type": "object",
  "required": [
    "metaData",
    "configuration",
    "components"
  ],
  "properties": {
    "metaData": {
      "description": "Meta information with no impact to the form itself",
      "type": "object",
      "required": [
        "id",
        "version"
      ],
      "properties": {
        "id": {
          "description": "ID of the form",
          "type": ["number", "string"]
        },
        "name": {
          "description": "Name of the form",
          "type": "string"
        },
        "version": {
          "description": "Version",
          "type": "number"
        }
      }
    },
    "configuration": {
      "description": "General form configuration",
      "type": "object",
      "properties": {
        "validationUrl": {
          "description": "URL for server side validation",
          "type": "string"
        },
        "submitUrl": {
          "description": "URL for form submit",
          "type": "string"
        },
        "defaultLanguage": {
          "description": "Default language for the form",
          "type": "string"
        },
        "validateOnChange": {
          "description": "Trigger the validation on every change of the value",
          "type": "boolean"
        },
        "validateOnBlur": {
          "description": "Trigger the validation when the focus between fields changes",
          "type": "boolean"
        }
      }
    },
    "components": {
      "description": "UI components for the form",
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/definitions/component"
      }
    },
    "dataSchema": {
      "description": "Optional JSON Schema for client side data validation",
      "type": "object",
      "$ref": "https://json-schema.org/draft/2019-09/schema"
    },
    "state": {
      "description": "Optional object which defines the initial/current state of the form",
      "type": "object"
    }
  },
  "definitions": {
    "component": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": ["button", "checkbox", "checkboxgroup","container","datefield","fieldset","html","numberfield","radiogroup","textarea","textfield"]
        },
        "components": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/component"
          }
        }
      },
      "required": ["type"]
    }
  }
}

Keywords: