{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hilfe.gasto-hotel.de/advisories.schema.json",
  "title": "GASTO Hotel Advisory Feed",
  "description": "Maschinenlesbarer Feed aller veroeffentlichten Sicherheitsmeldungen fuer GASTO Hotel Produkte. Version 1 (gasto-advisory-v1).",
  "type": "object",
  "required": ["schema", "vendor", "generatedAt", "advisories"],
  "properties": {
    "schema": { "const": "gasto-advisory-v1" },
    "vendor": {
      "type": "object",
      "required": ["name", "contact", "policy"],
      "properties": {
        "name": { "type": "string" },
        "contact": { "type": "string", "format": "email" },
        "policy": { "type": "string", "format": "uri" }
      }
    },
    "generatedAt": { "type": "string", "format": "date-time" },
    "advisories": {
      "type": "array",
      "items": { "$ref": "#/$defs/advisory" }
    }
  },
  "$defs": {
    "advisory": {
      "type": "object",
      "required": [
        "id",
        "title",
        "severity",
        "published",
        "affected",
        "fixedIn",
        "description"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^GASTO-[0-9]{4}-[0-9]{4}$",
          "description": "Interne Advisory-ID im Format GASTO-YYYY-NNNN."
        },
        "title": { "type": "string" },
        "severity": { "enum": ["low", "medium", "high", "critical"] },
        "cvssScore": { "type": "number", "minimum": 0, "maximum": 10 },
        "cvssVector": { "type": "string" },
        "cve": { "type": "string", "pattern": "^CVE-[0-9]{4}-[0-9]{4,}$" },
        "published": { "type": "string", "format": "date-time" },
        "updated": { "type": "string", "format": "date-time" },
        "affected": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": ["product", "versionRange"],
            "properties": {
              "product": {
                "type": "string",
                "description": "z. B. 'GaHotelSrv', 'gahotel-install', 'housekeeping-app'."
              },
              "versionRange": {
                "type": "string",
                "description": "SemVer-Range, z. B. '<3.4.2' oder '>=2.0.0 <2.5.1'."
              }
            }
          }
        },
        "fixedIn": {
          "type": "string",
          "description": "Erste Version mit Fix."
        },
        "description": { "type": "string" },
        "workaround": { "type": "string" },
        "references": {
          "type": "array",
          "items": { "type": "string", "format": "uri" }
        },
        "acknowledgment": {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "handle": { "type": "string" },
            "url": { "type": "string", "format": "uri" }
          }
        }
      }
    }
  }
}
