{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ver.cy/models/wm-xct-040-model-composition-resolution/versions/0.1.0/policy.schema.json",
  "title": "Caller-supplied local composition authority policy",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "version",
    "id",
    "dimensionId",
    "owner",
    "actors",
    "purposes",
    "allowInstall",
    "allowedModelIds",
    "allowReviewableDrafts",
    "reviewers",
    "allowedOrigins",
    "validFrom",
    "validUntil"
  ],
  "properties": {
    "format": {
      "const": "vercy-composition-policy"
    },
    "version": {
      "const": 1
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9+.-]*:[^\\s]+$",
      "maxLength": 256
    },
    "dimensionId": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9+.-]*:[^\\s]+$",
      "maxLength": 256
    },
    "owner": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9+.-]*:[^\\s]+$",
      "maxLength": 256
    },
    "actors": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9+.-]*:[^\\s]+$",
        "maxLength": 256
      }
    },
    "purposes": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2048
      }
    },
    "allowInstall": {
      "type": "boolean"
    },
    "allowedModelIds": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9.-]{2,127}$"
      }
    },
    "allowReviewableDrafts": {
      "type": "boolean"
    },
    "reviewers": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9+.-]*:[^\\s]+$",
        "maxLength": 256
      }
    },
    "allowedOrigins": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "pattern": "^https://[a-z0-9.-]+(?::[0-9]+)?$"
      }
    },
    "validFrom": {
      "type": "string",
      "format": "date-time",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$"
    },
    "validUntil": {
      "type": "string",
      "format": "date-time",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$"
    }
  }
}
