{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://folio.mccal.dev/schema/v1/revoked.schema.json",
  "title": "Folio revocation list (signed)",
  "type": "object",
  "required": [
    "format",
    "timestamp",
    "packages"
  ],
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string"
    },
    "format": {
      "const": 1
    },
    "timestamp": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4102444800
    },
    "packages": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "versions",
          "reason"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)+$",
            "maxLength": 120
          },
          "versions": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^(\\*|([0-9]+:)?[0-9][A-Za-z0-9.+~]*(-[A-Za-z0-9.+~]+)?)$"
            },
            "maxItems": 64
          },
          "reason": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "maxItems": 5000
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "url",
          "reason"
        ],
        "additionalProperties": false,
        "properties": {
          "url": {
            "type": "string",
            "pattern": "^https://\\S+$",
            "maxLength": 2048
          },
          "reason": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "maxItems": 5000
    }
  }
}
