{
  "$schema": "http://json-schema.org/draft-07/schema",
  "allOf": [
    {
      "if": {
        "$ref": "../field-types/inputs.json"
      },
      "then": {
        "required": ["key"]
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "table"
          }
        },
        "required": ["type"]
      },
      "then": {
        "oneOf": [
          {
            "required": ["dataSource", "columns"]
          },
          {
            "required": ["dataSource", "columnsExpression"]
          }
        ]
      }
    },
    {
      "if": {
        "$ref": "../field-types/presentation-components.json"
      },
      "then": {
        "required": ["dataSource"]
      }
    },
    {
      "if": {
        "properties": {
          "type": {
            "const": "expression"
          }
        },
        "required": ["type"]
      },
      "then": {
        "required": ["expression", "computeOn"]
      }
    }
  ]
}
