{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://kostavo-oss.github.io/tools/stevin/schema/project.json",
  "title": "stevin project",
  "description": "stevin.yml. https://kostavo-oss.github.io/tools/stevin/spec/#the-project-file",
  "type": "object",
  "properties": {
    "bundle": {
      "type": "string",
      "description": "A databricks.yml whose targets to use."
    },
    "contract_roles": {
      "type": "object",
      "description": "Who a data contract's roles are here: a role's name to a principal, or a list of them; [] for nobody. With this key, the roles of a contract a spec points at become grants: read gives SELECT, write gives SELECT and MODIFY.",
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string",
            "minLength": 1
          },
          {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        ]
      }
    },
    "dbt": {
      "type": "object",
      "properties": {
        "manifest": {
          "type": "string",
          "description": "dbt's target/manifest.json: what dbt builds."
        }
      },
      "additionalProperties": false,
      "required": [
        "manifest"
      ]
    },
    "history_schema": {
      "type": "string",
      "description": "Where apply keeps its run history."
    },
    "manage": {
      "type": "object",
      "description": "What stevin looks after here. Everything is managed unless it says otherwise; false hands it to another tool, and the key is then refused in a spec.",
      "properties": {
        "comments": {
          "type": "boolean"
        },
        "grants": {
          "type": "boolean"
        },
        "masks": {
          "type": "boolean"
        },
        "owner": {
          "type": "boolean"
        },
        "policies": {
          "type": "boolean"
        },
        "properties": {
          "type": "boolean"
        },
        "row_filters": {
          "type": "boolean"
        },
        "tags": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "owned_elsewhere": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Whose tables are whose: catalog.schema.table patterns, * for any part, to an owner \u2014 dbt, dlt, a team's name, or unknown. A ${\u2026} reference is one part. dbt's are refused; the others may be governed."
    },
    "schemas": {
      "type": "object",
      "description": "Per-schema mode, keyed catalog.schema. A ${\u2026} reference is one part.",
      "additionalProperties": {
        "enum": [
          "additive",
          "strict"
        ]
      }
    },
    "specs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Spec files or directories."
    },
    "targets": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "default": {
            "type": "boolean",
            "description": "Used when -t is left out."
          },
          "mode": {
            "enum": [
              "additive",
              "strict"
            ],
            "description": "additive never drops; strict drops orphans."
          },
          "profile": {
            "type": "string",
            "description": "A ~/.databrickscfg profile."
          },
          "vars": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "What `${name}` becomes in specs."
          },
          "warehouse_id": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "version": {
      "type": "integer"
    }
  },
  "additionalProperties": false
}
