{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$id": "http://chameleon-notation/field-base.json#",
  "title": "Base field",
  "description": "Schema defines base field definition",
  "type": "object",
  "definitions": {
    "name": {
      "type": "string"
    },
    "label": {
      "type": ["string", "null"]
    },
    "prependIcon": {
      "type": ["string", "null", "boolean"],
      "cn-allowedBooleanType": false
    },
    "appendIcon": {
      "type": ["string", "null", "boolean"],
      "cn-allowedBooleanType": false
    },
    "prefix": {
      "type": ["string", "null", "boolean"],
      "cn-allowedBooleanType": false,
      "maxLength": 3
    },
    "suffix": {
      "type": ["string", "null", "boolean"],
      "cn-allowedBooleanType": false,
      "maxLength": 6
    },
    "placeholder": {
      "type": ["string", "null", "boolean"],
      "cn-allowedBooleanType": false
    },
    "hint": {
      "type": ["string", "null", "boolean"],
      "cn-allowedBooleanType": false
    },
    "persistentHint": {
      "type": "boolean"
    },
    "color": {
      "type": ["string", "null"]
    },
    "disabled": {
      "type": ["boolean", "null"]
    },
    "tooltip": {
      "type": ["string", "null"]
    },
    "multiLine": {
      "type": "boolean"
    },
    "clearable": {
      "type": "boolean"
    },
    "validateOn": {
      "type": ["string", "null"]
    },
    "mask": {
      "type": "object",
      "properties": {
        "predefined": {
          "type": ["boolean", "null", "string"]
        },
        "value": {
          "type": ["string", "null"]
        }
      }
    },
    "validation": {
      "type": ["null", "object"],
      "properties": {
        "required": {
          "type": "boolean"
        },
        "minLength": {
          "type": ["null", "number"],
          "multipleOf": 1
        },
        "maxLength": {
          "type": ["null", "number"],
          "multipleOf": 1
        },
        "max": {
          "type": ["number", "null"]
        },
        "min": {
          "type": ["number", "null"]
        },
        "minCount": {
          "type": ["number", "null"]
        },
        "maxCount": {
          "type": ["number", "null"]
        },
        "pattern": {
          "type": "object",
          "properties": {
            "predefined": {
              "type": ["null", "string"]
            },
            "value": {
              "type": ["string", "null"]
            }
          }
        },
        "custom": {
          "type": ["string", "null"]
        }
      },
      "anyOf": [
        { "required": ["required"] },
        { "required": ["minLength"] },
        { "required": ["maxLength"] },
        { "required": ["max"] },
        { "required": ["min"] },
        { "required": ["minCount"] },
        { "required": ["maxCount"] },
        { "required": ["pattern"] },
        { "required": ["custom"] }
      ]
    },
    "value": {
      "type": ["string", "null"]
    }
  },
  "errorMessage": {
    "properties": {
      "label": "Yo, type is wrong for text field"
    }
  },
  "required": ["type"]
}
