{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "definitions": {
    "inputType": {
      "type": "string",
      "enum": ["date", "datetime-local", "number", "select", "text", "textarea", "url"]
    }
  },
  "properties": {
    "model": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "value": { "type": "string" },
          "inputType": { "$ref": "#/definitions/inputType" },
          "refData": { "type": "string" }
        },
        "required": ["value", "inputType"],
        "if": {
          "properties": { "inputType": { "const": "select" } }
        },
        "then": {
          "required": ["refData"]
        }
      }
    },
    "systems": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ID": { "type": "string" },
          "TEXT": { "type": "string" },
          "TYPE": { "type": "string" }
        },
        "required": ["ID", "TEXT", "TYPE"],
        "additionalProperties": {
          "type": "string"
        }
      }
    },
    "interactions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ID": { "type": "string" },
          "FROMID": { "type": "string" },
          "TOID": { "type": "string" },
          "TEXT": { "type": "string" },
          "TYPE": { "type": "string" }
        },
        "required": ["ID", "FROMID", "TOID", "TEXT", "TYPE"],
        "additionalProperties": {
          "type": "string"
        }
      }
    }
  },
  "required": ["model", "systems", "interactions"]
}
