{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/dbt-selectors/latest.json",
  "title": "selectors",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/latest/selectors-latest.json",
    "sourceSha256": "b9fde05e813fe8e979c5e5cdff413ad01677db02f579493c033296c827800125",
    "fileMatch": [
      "**/*dbt*/selectors.yaml",
      "**/*dbt*/selectors.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "selectors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "default": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "\\{\\{.*\\}\\}"
              },
              {
                "type": "boolean"
              }
            ],
            "additionalProperties": false
          },
          "definition": {
            "oneOf": [
              {
                "$ref": "#/$defs/definition_block"
              },
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/union_block"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "minItems": 1
    }
  },
  "$defs": {
    "boolean_or_jinja_string": {
      "oneOf": [
        {
          "$ref": "#/$defs/jinja_string"
        },
        {
          "type": "boolean"
        }
      ],
      "additionalProperties": false
    },
    "definition_block": {
      "type": "object",
      "properties": {
        "children": {
          "$ref": "#/$defs/boolean_or_jinja_string"
        },
        "children_depth": {
          "type": "number"
        },
        "childrens_parents": {
          "$ref": "#/$defs/boolean_or_jinja_string"
        },
        "indirect_selection": {
          "type": "string",
          "enum": [
            "buildable",
            "cautious",
            "eager"
          ]
        },
        "method": {
          "type": "string",
          "enum": [
            "config",
            "exposure",
            "file",
            "fqn",
            "group",
            "metric",
            "package",
            "path",
            "result",
            "source",
            "source_status",
            "state",
            "tag",
            "test_name",
            "test_type",
            "wildcard"
          ]
        },
        "parents": {
          "$ref": "#/$defs/boolean_or_jinja_string"
        },
        "parents_depth": {
          "type": "number"
        },
        "value": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "exclude_block": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/intersection_block"
          },
          {
            "$ref": "#/$defs/definition_block"
          }
        ]
      }
    },
    "intersection_block": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/definition_block"
      }
    },
    "jinja_string": {
      "type": "string",
      "pattern": "\\{\\{.*\\}\\}"
    },
    "union_block": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/intersection_block"
          },
          {
            "$ref": "#/$defs/definition_block"
          },
          {
            "$ref": "#/$defs/exclude_block"
          }
        ]
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "selectors"
  ]
}
