{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$id": "http://chameleon-notation/field-number.json#",
  "title": "Number field",
  "description": "Schema defines number field",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": ["number"]
    },
    "appendIcon": {
      "$ref": "field-base.json#/definitions/appendIcon"
    },
    "clearable": {
      "$ref": "field-base.json#/definitions/clearable"
    },
    "hint": {
      "$ref": "field-base.json#/definitions/hint"
    },
    "label": {
      "$ref": "field-base.json#/definitions/label"
    },
    "mask": {
      "$ref": "field-base.json#/definitions/mask"
    },
    "multiLine": {
      "enum": [null, false]
    },
    "name": {
      "$ref": "field-base.json#/definitions/name"
    },
    "persistentHint": {
      "$ref": "field-base.json#/definitions/persistentHint"
    },
    "placeholder": {
      "$ref": "field-base.json#/definitions/placeholder"
    },
    "prefix": {
      "$ref": "field-base.json#/definitions/prefix"
    },
    "prependIcon": {
      "$ref": "field-base.json#/definitions/prependIcon"
    },
    "step": {
      "type": ["number", "boolean", "null"]
    },
    "suffix": {
      "$ref": "field-base.json#/definitions/suffix"
    },
    "tooltip": {
      "$ref": "field-base.json#/definitions/tooltip"
    },
    "validateOn": {
      "$ref": "field-base.json#/definitions/validateOn"
    },
    "validation": {
      "$ref": "field-base.json#/definitions/validation"
    },
    "value": {
      "type": ["number", "null"]
    }
  },
  "allOf": [
    {
      "anyOf": [
        {
          "properties": {
            "validateOn": {
              "enum": ["blur", "input", "submit"]
            },
            "validation": {
              "type": "object"
            }
          }
        },
        {
          "properties": {
            "validateOn": {
              "enum": [null]
            },
            "validation": {
              "type": "null"
            }
          }
        }
      ]
    },
    {
      "anyOf": [{
        "properties": {
          "validation": {
            "properties": {
              "pattern": {
                "properties": {
                  "predefined": {
                    "enum": ["integer"]
                  }
                }
              }
            }
          },
          "step": {
            "cn-withDecimals": false
          }
        }
      },
        {
          "properties": {
            "validation": {
              "properties": {
                "pattern": {
                  "properties": {
                    "predefined": {
                      "not": {
                        "enum": ["integer"]
                      }
                    }
                  }
                }
              }
            },
            "step": {
              "cn-withDecimals": true
            }
          }
        }
      ]
    }
  ],
  "required": ["type"]
}
