{
  "openapi": "3.0.3",
  "info": {
    "title": "KreweLink Public API",
    "version": "1.0.0",
    "description": "Public edge-function endpoints for the KreweLink parade community platform. These endpoints return aggregate, non-personal data used by the homepage and city pages.",
    "contact": {
      "name": "KreweLink",
      "url": "https://krewelink.com/help"
    }
  },
  "servers": [
    { "url": "https://jtrjojitgilzxhzuunhk.supabase.co/functions/v1" }
  ],
  "paths": {
    "/public-stats": {
      "get": {
        "summary": "Platform-wide public statistics",
        "description": "Returns aggregate counts: open rider spots, registered captains, parade interests, float rentals, bands, and dance teams.",
        "responses": {
          "200": {
            "description": "Aggregate public statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "openSpots": { "type": "integer" },
                    "captains": { "type": "integer" },
                    "interested": { "type": "integer" },
                    "floatRentals": { "type": "integer" },
                    "bands": { "type": "integer" },
                    "danceTeams": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/resolve-geo": {
      "get": {
        "summary": "Resolve visitor region",
        "description": "Returns a detected city region slug for routing users to the nearest parade directory.",
        "responses": {
          "200": {
            "description": "Resolved region slug",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": { "city": { "type": "string" } }
                }
              }
            }
          }
        }
      }
    }
  }
}
