{
  "$defs": {
    "DataProcessor": {
      "description": "A data processor entry in a data protection policy.",
      "properties": {
        "data_categories": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "dpa_status": {
          "type": [
            "string",
            "null"
          ]
        },
        "hosting_region": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "service": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    },
    "PolicyCustom": {
      "description": "Typed custom extension data for `Policy`.",
      "properties": {
        "processors": {
          "items": {
            "$ref": "#/$defs/DataProcessor"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "PolicyStatus": {
      "description": "Policy lifecycle status.",
      "enum": [
        "draft",
        "active",
        "under-review",
        "archived"
      ],
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.7.1/policy.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Organizational policy document.",
  "properties": {
    "custom": {
      "anyOf": [
        {
          "$ref": "#/$defs/PolicyCustom"
        },
        {
          "type": "null"
        }
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "effective_date": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "name": {
      "type": "string"
    },
    "owner": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ]
    },
    "provisions": {
      "default": [],
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "related_decisions": {
      "default": [],
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "review_date": {
      "anyOf": [
        {
          "$ref": "#/$defs/IsoDate"
        },
        {
          "type": "null"
        }
      ]
    },
    "scope": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "$ref": "#/$defs/PolicyStatus"
    }
  },
  "required": [
    "id",
    "name",
    "status"
  ],
  "title": "Policy",
  "type": "object"
}