{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smarterweather-com/json-schema/smarterweather-com-platform-status-schema.json",
  "title": "PlatformStatus",
  "description": "Platform data-freshness status document, regenerated ~every 5\nminutes by the freshness monitor. Additional fields may be added\nover time; consumers must ignore unknown fields.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smarterweather-com-meta-api-openapi.yml#/components/schemas/PlatformStatus",
  "type": "object",
  "required": [
    "version",
    "generated_at",
    "overall",
    "sources"
  ],
  "properties": {
    "version": {
      "type": "integer",
      "description": "Document schema version."
    },
    "generated_at": {
      "type": "string",
      "format": "date-time",
      "description": "When this document was generated (UTC)."
    },
    "overall": {
      "type": "string",
      "enum": [
        "ok",
        "degraded",
        "outage",
        "no_signal"
      ],
      "description": "Worst state across customer-facing sources. `ok` means all\ncustomer-facing weather data is flowing within its expected\ncadence.\n"
    },
    "sources": {
      "type": "array",
      "description": "Per-source freshness states.",
      "items": {
        "$ref": "#/$defs/PlatformStatusSource"
      }
    },
    "advisories": {
      "type": "array",
      "description": "Active advisories relayed from upstream data providers (e.g.\nNOAA/NWS service notices) that may explain or foreshadow data\ngaps.\n",
      "items": {
        "$ref": "#/$defs/PlatformStatusAdvisory"
      }
    }
  },
  "$defs": {
    "PlatformStatusAdvisory": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "Advisory headline from the provider."
        },
        "provider_id": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Link to the provider's advisory."
        },
        "published_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the provider published the advisory (UTC)."
        }
      }
    },
    "PlatformStatusSource": {
      "type": "object",
      "required": [
        "source_id",
        "name",
        "provider_id",
        "state",
        "severity"
      ],
      "properties": {
        "source_id": {
          "type": "string",
          "description": "Stable source identifier."
        },
        "name": {
          "type": "string",
          "description": "Human-readable source name."
        },
        "provider_id": {
          "type": "string",
          "description": "Upstream data provider identifier."
        },
        "state": {
          "type": "string",
          "enum": [
            "ok",
            "degraded",
            "outage",
            "no_signal"
          ]
        },
        "severity": {
          "type": "string",
          "enum": [
            "customer_facing",
            "internal"
          ],
          "description": "Whether staleness of this source is visible to end customers\n(`customer_facing`) or only affects Smarter Weather's own\nproducts (`internal`).\n"
        },
        "incident": {
          "type": "object",
          "description": "Present when state is not `ok` and an incident is open.",
          "properties": {
            "cause": {
              "type": "string",
              "description": "Root-cause attribution, e.g. `provider_outage` (upstream\nstopped publishing), `processing_delay` (data arrived but\nis stuck in the pipeline), `serving_delay`, or\n`poller_stale` (our polling stopped; provider state\nunknown).\n"
            },
            "since": {
              "type": "string",
              "format": "date-time",
              "description": "When the incident opened (UTC)."
            },
            "status": {
              "type": "string",
              "description": "Incident lifecycle status (e.g. open, recovering)."
            }
          }
        }
      }
    }
  }
}