{
  "openapi": "3.0.3",
  "info": {
    "title": "Leon Du Public API",
    "description": "Public read-only resources on leondu.com for agents discovering Leon Du / 杜立刚. No authentication. No write API. No webhooks. Content negotiation: Accept text/markdown for markdown variants; Accept application/json for JSON 404 errors.",
    "version": "1.1.0",
    "contact": {
      "name": "Leon Du",
      "url": "https://leondu.com/developers/"
    }
  },
  "servers": [
    {
      "url": "https://leondu.com"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "getHomepage",
        "summary": "Leon Du homepage",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "text/html",
                "text/markdown"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Homepage HTML or markdown"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "Leon Du agent site index (llms.txt)",
        "responses": {
          "200": {
            "description": "llms.txt plain text"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "Leon Du OpenAPI document",
        "responses": {
          "200": {
            "description": "OpenAPI 3.0.3 JSON"
          }
        }
      }
    },
    "/api/openapi.json": {
      "get": {
        "operationId": "getOpenApiUnderApi",
        "summary": "Leon Du OpenAPI (under /api/)",
        "responses": {
          "200": {
            "description": "OpenAPI 3.0.3 JSON"
          }
        }
      }
    },
    "/api/index.json": {
      "get": {
        "operationId": "getApiIndex",
        "summary": "Leon Du public API index",
        "responses": {
          "200": {
            "description": "JSON index"
          }
        }
      }
    },
    "/developers/": {
      "get": {
        "operationId": "getDeveloperResources",
        "summary": "Leon Du developer resources index",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "text/html",
                "text/markdown"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Developer resources"
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "operationId": "getSitemap",
        "summary": "Site sitemap",
        "responses": {
          "200": {
            "description": "XML sitemap"
          }
        }
      }
    },
    "/blog/index.xml": {
      "get": {
        "operationId": "getBlogRss",
        "summary": "Blog RSS",
        "responses": {
          "200": {
            "description": "RSS feed"
          }
        }
      }
    },
    "/about/": {
      "get": {
        "operationId": "getAbout",
        "summary": "About Leon Du",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "text/html",
                "text/markdown"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "About page"
          }
        }
      }
    },
    "/work/": {
      "get": {
        "operationId": "getWork",
        "summary": "Work / portfolio",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "schema": {
              "type": "string",
              "enum": [
                "text/html",
                "text/markdown"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Work page"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "status"
            ],
            "properties": {
              "code": {
                "type": "string",
                "example": "not_found"
              },
              "message": {
                "type": "string"
              },
              "status": {
                "type": "integer",
                "example": 404
              },
              "hint": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "responses": {
      "NotFound": {
        "description": "Path does not exist. JSON when Accept includes application/json or path is under /api/.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "text/markdown": {
            "schema": {
              "type": "string"
            }
          },
          "text/html": {
            "schema": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
