{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$id": "http://chameleon-notation/field-money.json#",
  "title": "Money field",
  "description": "Schema defines money field",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": ["money"]
    },
    "appendIcon": {
      "$ref": "field-base.json#/definitions/appendIcon"
    },
    "clearable": {
      "$ref": "field-base.json#/definitions/clearable"
    },
    "currency": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "symbol": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "hint": {
      "$ref": "field-base.json#/definitions/hint"
    },
    "label": {
      "$ref": "field-base.json#/definitions/label"
    },
    "name": {
      "$ref": "field-base.json#/definitions/name"
    },
    "persistentHint": {
      "$ref": "field-base.json#/definitions/persistentHint"
    },
    "placeholder": {
      "$ref": "field-base.json#/definitions/placeholder"
    },
    "prefix": {
      "enum": ["name", "symbol", null, false]
    },
    "prependIcon": {
      "$ref": "field-base.json#/definitions/prependIcon"
    },
    "suffix": {
      "enum": ["name", "symbol", null, false]
    },
    "tooltip": {
      "$ref": "field-base.json#/definitions/tooltip"
    },
    "validateOn": {
      "$ref": "field-base.json#/definitions/validateOn"
    },
    "validation": {
      "type": ["null", "object"],
      "properties": {
        "required": {
          "type": "boolean"
        },
        "pattern": {
          "type": "object",
          "properties": {
            "value": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      },
      "anyOf": [
        { "required": ["required"] },
        { "required": ["pattern"] }
      ]
    },
    "value": {
      "$ref": "field-base.json#/definitions/value"
    }
  },
  "anyOf": [
    {
      "properties": {
        "validateOn": {
          "enum": ["blur", "input", "submit"]
        },
        "validation": {
          "type": "object"
        }
      }
    },
    {
      "properties": {
        "validateOn": {
          "enum": [null]
        },
        "validation": {
          "type": "null"
        }
      }
    }
  ],
  "required": ["type"]
}
