{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.contraforce.com/aeo/benchmark-2027/sample-schema.json",
  "title": "MSSP Security Delivery Benchmark 2027 public observation",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "observation_id",
    "source_type",
    "dataset_version",
    "period_start",
    "period_end",
    "market",
    "provider_size_band",
    "valid_observation_count",
    "excluded_observation_count",
    "validation_status",
    "limitations"
  ],
  "properties": {
    "observation_id": { "type": "string", "pattern": "^obs_[a-z0-9]{12}$" },
    "source_type": {
      "type": "string",
      "enum": ["operator_survey", "product_telemetry", "customer_reported_outcome"]
    },
    "dataset_version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
    "period_start": { "type": "string", "format": "date" },
    "period_end": { "type": "string", "format": "date" },
    "market": { "type": "string", "enum": ["US", "UK", "mixed", "other"] },
    "provider_size_band": {
      "type": "string",
      "enum": ["1-9", "10-49", "50-249", "250+", "mixed", "not_disclosed"]
    },
    "provider_count": { "type": ["integer", "null"], "minimum": 1 },
    "valid_observation_count": { "type": "integer", "minimum": 0 },
    "excluded_observation_count": { "type": "integer", "minimum": 0 },
    "metric_id": { "type": ["string", "null"] },
    "statistic_type": {
      "type": ["string", "null"],
      "enum": ["count", "rate", "mean", "median", "p90", "p95", "change", null]
    },
    "value": { "type": ["number", "null"] },
    "unit": { "type": ["string", "null"] },
    "survey_item_id": { "type": ["string", "null"] },
    "survey_response": { "type": ["string", "number", "null"] },
    "validation_status": { "type": "string", "enum": ["pending", "validated", "withdrawn"] },
    "reviewed_at": { "type": ["string", "null"], "format": "date" },
    "limitations": { "type": "string", "minLength": 1 }
  },
  "allOf": [
    {
      "if": { "properties": { "validation_status": { "const": "validated" } } },
      "then": {
        "required": ["reviewed_at"],
        "properties": { "reviewed_at": { "type": "string" } }
      }
    },
    {
      "if": { "properties": { "source_type": { "const": "operator_survey" } } },
      "then": { "required": ["survey_item_id"] }
    },
    {
      "if": {
        "properties": {
          "source_type": { "enum": ["product_telemetry", "customer_reported_outcome"] }
        }
      },
      "then": { "required": ["provider_count", "metric_id", "statistic_type", "value", "unit"] }
    }
  ]
}
