{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Evidence-backed vulnerability navigation",
  "description": "Navigation placement and evidence-backed annotations for the canonical vulnerability-types hub; no keyword-based classification or copied event dates.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "publication_years",
    "types",
    "memberships"
  ],
  "properties": {
    "schema_version": {
      "const": "1.1.0"
    },
    "publication_years": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 2000
      },
      "minItems": 1,
      "uniqueItems": true,
      "const": [
        2025,
        2026
      ]
    },
    "types": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "description",
          "parent_id",
          "aliases",
          "family_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "parent_id": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
              },
              {
                "type": "null"
              }
            ]
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            },
            "minItems": 0,
            "uniqueItems": true
          },
          "family_id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "description": "Display placement in a vulnerability_family from category-navigation.json. Children share their parent family; this does not assign record classifications."
          }
        }
      },
      "minItems": 1,
      "uniqueItems": true
    },
    "memberships": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "collection",
          "record_id",
          "type_id",
          "basis",
          "source_ids",
          "evidence_location",
          "rationale",
          "relevance_note"
        ],
        "properties": {
          "collection": {
            "enum": [
              "report",
              "resource"
            ]
          },
          "record_id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "type_id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "basis": {
            "enum": [
              "source_explicit",
              "analyst_mapping"
            ]
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            },
            "minItems": 1,
            "uniqueItems": true
          },
          "evidence_location": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "rationale": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          },
          "relevance_note": {
            "type": "string",
            "minLength": 1,
            "pattern": "\\S"
          }
        }
      },
      "minItems": 0,
      "uniqueItems": true
    }
  }
}
