{
  "openapi": "3.1.0",
  "info": {
    "title": "Neighbor Signal Edition Directory API",
    "version": "1.0.0",
    "description": "A public, read-only directory of Neighbor Signal school-system briefing editions. No authentication is required."
  },
  "servers": [
    {
      "url": "https://neighborsignal.com"
    }
  ],
  "paths": {
    "/api/editions.json": {
      "get": {
        "operationId": "listEditions",
        "summary": "List Neighbor Signal editions",
        "responses": {
          "200": {
            "description": "The current edition directory",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionDirectory"
                }
              }
            }
          }
        }
      }
    },
    "/status.json": {
      "get": {
        "operationId": "getStatus",
        "summary": "Read the static site's deployment status",
        "responses": {
          "200": {
            "description": "The deployed static service is reachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EditionDirectory": {
        "type": "object",
        "required": ["name", "url", "editions"],
        "properties": {
          "name": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "editions": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Edition" }
          }
        }
      },
      "Edition": {
        "type": "object",
        "required": ["name", "location", "status"],
        "properties": {
          "name": { "type": "string" },
          "location": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "status": { "type": "string", "enum": ["live", "research"] }
        }
      },
      "Status": {
        "type": "object",
        "required": ["status", "service"],
        "properties": {
          "status": { "type": "string", "const": "ok" },
          "service": { "type": "string", "const": "neighborsignal.com" }
        }
      }
    }
  }
}
