{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://thossullivan.github.io/model-eol/schema/0.1/model-eol.schema.json",
  "title": "model-eol feed",
  "description": "A machine-readable deprecation feed for AI models, version model-eol/0.1.",
  "type": "object",
  "required": ["spec", "publisher", "generated", "models"],
  "properties": {
    "spec": { "const": "model-eol/0.1" },
    "publisher": { "type": "string", "minLength": 1, "maxLength": 256 },
    "generated": { "type": "string", "format": "date-time" },
    "source": { "type": "string", "format": "uri" },
    "note": { "type": "string" },
    "policy": {
      "type": "object",
      "required": ["min_notice_days", "source"],
      "properties": {
        "min_notice_days": { "type": "integer", "minimum": 0 },
        "source": { "type": "string", "format": "uri" }
      },
      "additionalProperties": false
    },
    "models": {
      "type": "array",
      "items": { "$ref": "#/definitions/model" }
    }
  },
  "additionalProperties": false,
  "definitions": {
    "isoDate": { "type": "string", "format": "date" },
    "model": {
      "type": "object",
      "required": ["id"],
      "properties": {
        "id": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" },
        "aliases": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" }
        },
        "announced": { "$ref": "#/definitions/isoDate" },
        "shutdown": { "$ref": "#/definitions/isoDate" },
        "date_precision": { "enum": ["exact", "earliest"] },
        "replacement": { "type": "string", "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" },
        "replacement_options": {
          "type": "array",
          "minItems": 1,
          "items": { "type": "string", "maxLength": 256, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" }
        },
        "replacement_note": { "type": "string" },
        "notes": { "type": "string" },
        "source": { "type": "string", "format": "uri" },
        "distributions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["via"],
            "properties": {
              "via": { "type": "string", "minLength": 1 },
              "announced": { "$ref": "#/definitions/isoDate" },
              "shutdown": { "$ref": "#/definitions/isoDate" },
              "date_precision": { "enum": ["exact", "earliest"] },
              "status": { "enum": ["active", "legacy", "extended-access", "retired"] },
              "source": { "type": "string", "format": "uri" }
            },
            "additionalProperties": false
          }
        }
      },
      "dependencies": {
        "replacement": {
          "properties": {
            "replacement_options": false
          }
        },
        "replacement_options": {
          "properties": {
            "replacement": false
          }
        }
      },
      "additionalProperties": false
    }
  }
}
