{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peppolstatus-com/json-schema/peppolstatus-com-sml-response-schema.json",
  "title": "SmlResponse",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peppolstatus-com-sml-api-openapi.yml#/components/schemas/SmlResponse",
  "type": "object",
  "required": [
    "zones"
  ],
  "properties": {
    "zones": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ZoneStatusView"
      }
    }
  },
  "$defs": {
    "IncidentTimelineStep": {
      "type": "object",
      "required": [
        "at",
        "severity"
      ],
      "properties": {
        "at": {
          "type": "string",
          "format": "date-time"
        },
        "severity": {
          "type": "string",
          "enum": [
            "up",
            "degraded",
            "down"
          ]
        }
      }
    },
    "Verdict": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "up",
        "degraded",
        "down",
        null
      ],
      "description": "Per-location host verdict; null when unknown."
    },
    "ZoneCanary": {
      "type": "object",
      "required": [
        "location",
        "verdict",
        "existing_ok",
        "existing_total",
        "nonexistent_ok",
        "nonexistent_total",
        "critical_nxdomain",
        "soa_serial",
        "ns",
        "observed_at"
      ],
      "properties": {
        "location": {
          "type": "string"
        },
        "verdict": {
          "type": "string",
          "enum": [
            "up",
            "degraded",
            "down"
          ]
        },
        "existing_ok": {
          "type": "integer"
        },
        "existing_total": {
          "type": "integer"
        },
        "nonexistent_ok": {
          "type": "integer"
        },
        "nonexistent_total": {
          "type": "integer"
        },
        "critical_nxdomain": {
          "type": "boolean"
        },
        "soa_serial": {
          "type": [
            "integer",
            "null"
          ]
        },
        "ns": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "observed_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "ZoneIncidentView": {
      "type": "object",
      "required": [
        "id",
        "zone",
        "status",
        "severity",
        "started_at",
        "ended_at",
        "timeline"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "zone": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "closed"
          ]
        },
        "severity": {
          "type": "string",
          "enum": [
            "up",
            "degraded",
            "down"
          ]
        },
        "started_at": {
          "type": "string",
          "format": "date-time"
        },
        "ended_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "timeline": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/IncidentTimelineStep"
          }
        }
      }
    },
    "ZoneStatusView": {
      "type": "object",
      "required": [
        "zone",
        "kind",
        "env",
        "operator",
        "verdict",
        "critical_nxdomain",
        "cutover",
        "canary",
        "management",
        "incidents"
      ],
      "properties": {
        "zone": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "SML",
            "SMK"
          ]
        },
        "env": {
          "type": "string"
        },
        "operator": {
          "type": "string"
        },
        "verdict": {
          "$ref": "#/$defs/Verdict"
        },
        "critical_nxdomain": {
          "type": "boolean"
        },
        "cutover": {
          "type": "object",
          "required": [
            "dname_present",
            "dname_target"
          ],
          "properties": {
            "dname_present": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "dname_target": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "canary": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ZoneCanary"
          }
        },
        "management": {
          "type": "object",
          "required": [
            "host",
            "tls_ok",
            "tls_not_after",
            "tls_issuer"
          ],
          "properties": {
            "host": {
              "type": [
                "string",
                "null"
              ]
            },
            "tls_ok": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "tls_not_after": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            },
            "tls_issuer": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        "incidents": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ZoneIncidentView"
          }
        }
      }
    }
  }
}