{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whenisbins-com/json-schema/whenisbins-com-council-schema.json",
  "title": "Council",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whenisbins-com-openapi.yaml#/components/schemas/Council",
  "allOf": [
    {
      "$ref": "#/$defs/CouncilRef"
    },
    {
      "type": "object",
      "required": [
        "coverage"
      ],
      "properties": {
        "coverage": {
          "type": "string",
          "enum": [
            "live",
            "degraded",
            "unsupported"
          ]
        },
        "reason_code": {
          "type": "string",
          "description": "Reviewed structural reason, present only for a declared unsupported council.",
          "enum": [
            "captcha-required",
            "checker-withdrawn",
            "checker-withdrawn-or-login-required",
            "resident-login-required",
            "site-access-blocked"
          ]
        }
      }
    }
  ],
  "$defs": {
    "CouncilRef": {
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "GSS code — the canonical, rename-proof council identity."
        },
        "name": {
          "type": "string"
        },
        "lookup_url": {
          "type": "string",
          "format": "uri",
          "description": "The council's own bin-day checker page, when known (https only).\nThe honest fallback for the citizen on every wait and failure —\nthe same page a served Schedule reports as `source_url`.\n"
        },
        "missed_bin_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Council-specific HTTPS operational missed-collection reporting page,\nfrom the approved verified reporting registry. Null when unavailable;\nnever substituted with the checker, broader problem or formal complaint\nroute. Returned on council discovery, lookup and schedule council objects.\nThe council's page sets its own reporting rules. WhenIsBins reads\ncollection dates only: it does not set reminders or report missed bins.\n"
        },
        "missed_bin_checked_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Registry verification date (YYYY-MM-DD) for the published reporting\nroute, not the schedule retrieval time or a live availability check.\nNull when missed_bin_url is null. Approved links remain published until\nreviewed and withdrawn or updated, even when their review date has passed.\n"
        }
      }
    }
  }
}