{
  "openapi": "3.1.0",
  "info": {
    "title": "Ashwin Gopalsamy Developer API",
    "version": "1.0.0",
    "description": "Authoritative public API and discovery metadata for Ashwin Gopalsamy's personal website, payments engineering notes, Model Context Protocol server, CLI tool, and developer resources.",
    "contact": {
      "name": "Ashwin Gopalsamy",
      "email": "hello@ashwingopalsamy.in",
      "url": "https://ashwingopalsamy.in/contact"
    },
    "license": {
      "name": "MIT",
      "url": "https://ashwingopalsamy.in/LICENSE"
    },
    "x-versioning-policy": {
      "strategy": "url-path-and-header",
      "current_version": "v1",
      "api_version_header": "API-Version",
      "deprecation_policy": "Deprecation announced minimum 6 months prior to retirement with Sunset header (RFC 8594) and Deprecation header (RFC 9594), documented at /developers.",
      "sunset_header": "Sunset",
      "deprecation_header": "Deprecation",
      "policy_url": "https://ashwingopalsamy.in/developers#versioning"
    }
  },
  "servers": [
    {
      "url": "https://ashwingopalsamy.in",
      "description": "Production and sandbox environment (free open access)"
    }
  ],
  "x-service-info": {
    "categories": ["agent-discovery", "read-only-profile", "developer-resources"],
    "status": "operational"
  },
  "paths": {
    "/api/v1/profile": {
      "get": {
        "operationId": "getProfileV1",
        "summary": "Get authoritative profile summary",
        "description": "Returns Ashwin Gopalsamy's verified career history, current role at Pismo (a Visa company), location, and domain expertise.",
        "responses": {
          "200": {
            "description": "Authoritative profile summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileSummary"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "searchSiteV1",
        "summary": "Search public site manifest",
        "description": "Searches published technical notes, craft projects, and reading list entries by keyword or phrase.",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Search phrase or topic keyword",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of items to return (1-50)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results matching query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter supplied",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/content": {
      "get": {
        "operationId": "listContentV1",
        "summary": "List public content items",
        "description": "Returns items from the public site content catalog filtered by kind.",
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Content kind filter",
            "schema": {
              "type": "string",
              "enum": ["all", "note", "craft", "book", "watch", "article"],
              "default": "all"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of items to return (1-50)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of catalog items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContentList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notes/{slug}": {
      "get": {
        "operationId": "getNoteMarkdownV1",
        "summary": "Get note Markdown by slug",
        "description": "Returns the raw Markdown body and metadata for a published technical note.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Published note slug identifier",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Note raw Markdown body and slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteMarkdown"
                }
              }
            }
          },
          "400": {
            "description": "Invalid slug format",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Note not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/status": {
      "get": {
        "operationId": "getStatusV1",
        "summary": "Get API operational status",
        "description": "Returns operational status, versioning details, and protocol links.",
        "responses": {
          "200": {
            "description": "API status and capability metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiStatus"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api": {
      "get": {
        "operationId": "getApiIndex",
        "summary": "Get API index",
        "description": "Returns a read-only API index pointing to the public endpoints. No authentication or payment is required.",
        "responses": {
          "200": {
            "description": "API index",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ProblemDetails": {
        "type": "object",
        "description": "RFC 9457 Problem Details error model for machine error handling",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "A URI reference identifying the problem type"
          },
          "title": {
            "type": "string",
            "description": "A short, human-readable summary of the problem"
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code"
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation specific to this occurrence"
          },
          "code": {
            "type": "string",
            "description": "Machine-readable error code"
          },
          "resolution_hint": {
            "type": "string",
            "description": "Actionable instructions for an agent to recover from this error"
          },
          "instance": {
            "type": "string",
            "format": "uri",
            "description": "A URI reference identifying the specific occurrence"
          }
        },
        "required": ["type", "title", "status", "detail", "code", "resolution_hint"]
      },
      "ProfileSummary": {
        "type": "object",
        "description": "Authoritative machine-readable career profile",
        "properties": {
          "name": { "type": "string", "example": "Ashwin Gopalsamy" },
          "role": { "type": "string", "example": "Staff Software Engineer" },
          "employer": { "type": "string", "example": "Pismo, a Visa company" },
          "location": { "type": "string", "example": "Pollachi, Tamil Nadu" },
          "primaryLanguage": { "type": "string", "example": "Go" },
          "summary": { "type": "string" },
          "knowsAbout": {
            "type": "array",
            "items": { "type": "string" }
          },
          "links": {
            "type": "object",
            "properties": {
              "home": { "type": "string", "format": "uri" },
              "ai": { "type": "string", "format": "uri" },
              "design": { "type": "string", "format": "uri" }
            },
            "required": ["home", "ai", "design"]
          }
        },
        "required": ["name", "role", "employer", "location", "primaryLanguage", "summary"]
      },
      "PaletteItem": {
        "type": "object",
        "description": "Item in public site content index",
        "properties": {
          "id": { "type": "string" },
          "kind": { "type": "string" },
          "title": { "type": "string" },
          "href": { "type": "string" },
          "description": { "type": "string" },
          "keywords": {
            "type": "array",
            "items": { "type": "string" }
          }
        },
        "required": ["id", "kind", "title", "href"]
      },
      "SearchResults": {
        "type": "object",
        "description": "Search response wrapper",
        "properties": {
          "query": { "type": "string" },
          "total": { "type": "integer" },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaletteItem"
            }
          }
        },
        "required": ["query", "total", "results"]
      },
      "ContentList": {
        "type": "object",
        "description": "Content listing response wrapper",
        "properties": {
          "kind": { "type": "string" },
          "count": { "type": "integer" },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaletteItem"
            }
          }
        },
        "required": ["kind", "count", "items"]
      },
      "NoteMarkdown": {
        "type": "object",
        "description": "Raw note markdown content",
        "properties": {
          "slug": { "type": "string" },
          "markdown": { "type": "string" }
        },
        "required": ["slug", "markdown"]
      },
      "ApiStatus": {
        "type": "object",
        "description": "API operational status information",
        "properties": {
          "service": { "type": "string", "example": "ashwingopalsamy.in-api" },
          "version": { "type": "string", "example": "v1" },
          "apiVersion": { "type": "string", "example": "2026-08-22" },
          "status": { "type": "string", "example": "operational" },
          "mode": { "type": "string", "example": "read-only-discovery" },
          "versioning": {
            "type": "object",
            "description": "API versioning and deprecation schedule",
            "properties": {
              "strategy": { "type": "string", "example": "url-path" },
              "current": { "type": "string", "example": "v1" },
              "deprecationPolicy": { "type": "string" },
              "sunsetHeader": { "type": "string", "example": "Sunset" },
              "deprecationHeader": { "type": "string", "example": "Deprecation" }
            },
            "required": ["strategy", "current", "deprecationPolicy"]
          },
          "capabilities": {
            "type": "object",
            "description": "Supported protocol and data capabilities",
            "properties": {
              "profile": { "type": "boolean", "example": true },
              "search": { "type": "boolean", "example": true },
              "contentListing": { "type": "boolean", "example": true },
              "noteMarkdown": { "type": "boolean", "example": true },
              "mcp": { "type": "boolean", "example": true },
              "a2a": { "type": "boolean", "example": true }
            },
            "required": ["profile", "search", "contentListing", "noteMarkdown", "mcp", "a2a"]
          },
          "links": {
            "type": "object",
            "description": "Standard protocol and documentation links",
            "properties": {
              "openapi": { "type": "string", "format": "uri" },
              "developers": { "type": "string", "format": "uri" },
              "mcp": { "type": "string", "format": "uri" },
              "a2a": { "type": "string", "format": "uri" },
              "llms": { "type": "string", "format": "uri" }
            },
            "required": ["openapi", "developers", "mcp", "a2a", "llms"]
          }
        },
        "required": ["service", "version", "apiVersion", "status", "mode", "versioning", "capabilities", "links"]
      },
      "ApiIndex": {
        "type": "object",
        "description": "Read-only API index",
        "properties": {
          "status": { "type": "string", "example": "discovery-only" },
          "message": { "type": "string" },
          "resolution_hint": { "type": "string" }
        },
        "required": ["status", "message", "resolution_hint"]
      }
    }
  }
}
