{
  "openapi": "3.1.0",
  "info": {
    "title": "VLSI Calendar Public API",
    "version": "1.0.0",
    "description": "Read-only, source-backed semiconductor event and CFP deadline records by VLSI Korea."
  },
  "servers": [{ "url": "https://calendar.vlsi.kr" }],
  "paths": {
    "/api/events": {
      "get": {
        "summary": "List structured events",
        "operationId": "listEvents",
        "parameters": [
          { "name": "from", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "to", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "region", "in": "query", "schema": { "type": "string" } },
          { "name": "topic", "in": "query", "schema": { "type": "string" } },
          { "name": "category", "in": "query", "schema": { "type": "string", "enum": ["industry", "company-technology", "earnings", "investor-relations", "shareholder-meeting", "financial-disclosure"] } },
          { "name": "verification", "in": "query", "schema": { "type": "string" } },
          { "name": "q", "in": "query", "schema": { "type": "string" } },
          { "name": "has_cfp", "in": "query", "schema": { "type": "boolean" } },
          { "name": "offset", "in": "query", "schema": { "type": "integer", "minimum": 0, "default": 0 } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } }
        ],
        "responses": { "200": { "description": "Paginated event collection", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventCollection" } } } } }
      }
    },
    "/api/events/{id}": {
      "get": {
        "summary": "Get one structured event",
        "operationId": "getEvent",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": { "description": "Structured event", "content": { "application/json": { "schema": { "type": "object", "properties": { "event": { "$ref": "#/components/schemas/Event" } }, "required": ["event"] } } } },
          "404": { "description": "Event not found" }
        }
      }
    },
    "/api/deadlines": {
      "get": {
        "summary": "List CFP and author deadlines",
        "operationId": "listDeadlines",
        "parameters": [
          { "name": "from", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "to", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "kind", "in": "query", "schema": { "type": "string" } },
          { "name": "precision", "in": "query", "schema": { "type": "string", "enum": ["exact-time", "date-only", "time-ambiguous"] } }
        ],
        "responses": { "200": { "description": "Deadline collection", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } } }
      }
    },
    "/api/catalog/status": {
      "get": {
        "summary": "Get live database revision and counts",
        "operationId": "getCatalogStatus",
        "responses": { "200": { "description": "Catalog ready", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true } } } } }
      }
    }
  },
  "components": {
    "schemas": {
      "EventCollection": {
        "type": "object",
        "required": ["schemaVersion", "catalogVerifiedAt", "total", "offset", "limit", "events"],
        "properties": {
          "schemaVersion": { "type": "string" },
          "catalogVerifiedAt": { "type": "string", "format": "date" },
          "total": { "type": "integer" },
          "offset": { "type": "integer" },
          "limit": { "type": "integer" },
          "nextOffset": { "type": ["integer", "null"] },
          "events": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } }
        }
      },
      "Event": {
        "type": "object",
        "required": ["schemaVersion", "id", "slug", "name", "schedule", "location", "classification", "organizer", "links", "deadlines", "media", "sources", "verification"],
        "properties": {
          "schemaVersion": { "type": "string" },
          "id": { "type": "string" },
          "slug": { "type": "string" },
          "seriesId": { "type": "string" },
          "editionYear": { "type": "integer" },
          "name": { "type": "string" },
          "description": { "type": "string" },
          "schedule": { "type": "object", "additionalProperties": true },
          "location": { "type": "object", "additionalProperties": true },
          "classification": { "type": "object", "additionalProperties": true },
          "organizer": { "type": "string" },
          "participatingCompanies": { "type": "array", "items": { "type": "string" } },
          "links": { "type": "object", "additionalProperties": true },
          "deadlines": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "media": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "sources": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "verification": { "type": "object", "additionalProperties": true }
        }
      }
    }
  }
}
