{
  "openapi": "3.0.3",
  "info": {
    "title": "gkosmo.eu Public API",
    "version": "1.0.0",
    "description": "Read-only, unauthenticated API exposing George Kosmopoulos's public profile, projects, blog posts, and reading notes."
  },
  "servers": [{ "url": "https://gkosmo.eu" }],
  "paths": {
    "/api/v1/public/profile": {
      "get": {
        "summary": "Profile and bio",
        "operationId": "getProfile",
        "responses": {
          "200": {
            "description": "Profile object",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Profile" } } }
          }
        }
      }
    },
    "/api/v1/public/projects": {
      "get": {
        "summary": "List projects",
        "operationId": "listProjects",
        "responses": {
          "200": {
            "description": "Array of projects",
            "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Project" } } } }
          }
        }
      }
    },
    "/api/v1/public/blogs": {
      "get": {
        "summary": "List blog posts",
        "operationId": "listBlogs",
        "responses": {
          "200": {
            "description": "Array of blog summaries",
            "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BlogSummary" } } } }
          }
        }
      }
    },
    "/api/v1/public/blogs/{slug}": {
      "get": {
        "summary": "Get a blog post",
        "operationId": "getBlog",
        "parameters": [{ "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": {
            "description": "Blog post",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Blog" } } }
          },
          "404": {
            "description": "Not found (JSON error body)",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          }
        }
      }
    },
    "/api/v1/public/books": {
      "get": {
        "summary": "List reading notes",
        "operationId": "listBooks",
        "responses": {
          "200": {
            "description": "Array of book summaries",
            "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BookSummary" } } } }
          }
        }
      }
    },
    "/api/v1/public/books/{slug}": {
      "get": {
        "summary": "Get a reading note",
        "operationId": "getBook",
        "parameters": [{ "name": "slug", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": {
            "description": "Book note",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Book" } } }
          },
          "404": {
            "description": "Not found (JSON error body)",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": { "type": "string", "example": "Not found" },
          "status": { "type": "integer", "example": 404 }
        }
      },
      "Profile": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "title": { "type": "string" },
          "location": { "type": "string" },
          "bio": { "type": "string" },
          "languages": { "type": "array", "items": { "type": "string" } },
          "skills": { "type": "array", "items": { "type": "string" } },
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "description": { "type": "string" }
              }
            }
          },
          "links": {
            "type": "object",
            "properties": {
              "website": { "type": "string", "format": "uri" },
              "email": { "type": "string", "format": "email" },
              "github": { "type": "string", "format": "uri" },
              "linkedin": { "type": "string", "format": "uri" },
              "rss": { "type": "string", "format": "uri" }
            }
          }
        }
      },
      "Project": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "slug": { "type": "string" },
          "description": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "status": { "type": "string" },
          "tech": { "type": "array", "items": { "type": "string" } }
        }
      },
      "BlogSummary": {
        "type": "object",
        "properties": {
          "title": { "type": "string" },
          "slug": { "type": "string" },
          "tldr": { "type": "string", "nullable": true },
          "published_at": { "type": "string", "format": "date-time" },
          "url": { "type": "string", "format": "uri" }
        }
      },
      "Blog": {
        "allOf": [
          { "$ref": "#/components/schemas/BlogSummary" },
          {
            "type": "object",
            "properties": {
              "body": { "type": "string", "description": "Plain-text body of the post" }
            }
          }
        ]
      },
      "BookSummary": {
        "type": "object",
        "properties": {
          "title": { "type": "string" },
          "slug": { "type": "string" },
          "authors": { "type": "array", "items": { "type": "string" } },
          "genre": { "type": "string", "nullable": true },
          "year": { "type": "integer", "nullable": true },
          "read_year": { "type": "integer", "nullable": true },
          "synopsis": { "type": "string", "nullable": true },
          "url": { "type": "string", "format": "uri" }
        }
      },
      "Book": {
        "allOf": [
          { "$ref": "#/components/schemas/BookSummary" },
          {
            "type": "object",
            "properties": {
              "comment": { "type": "string", "nullable": true, "description": "George's personal note on the book" }
            }
          }
        ]
      }
    }
  }
}
