{
  "openapi": "3.1.0",
  "info": {
    "title": "리아한의원 김포본점 공개 콘텐츠 API",
    "version": "1.0.0",
    "description": "리아한의원 김포본점이 이미 공개한 홈페이지 페이지와 글을 검색·조회하는 읽기 전용 API입니다. 예약 실행, 환자정보 처리, 개인별 진단 또는 의료상담 기능은 제공하지 않습니다."
  },
  "servers": [
    {
      "url": "https://liagimpo.kr",
      "description": "리아한의원 김포본점 운영 사이트"
    }
  ],
  "externalDocs": {
    "description": "AI 에이전트용 사이트 안내",
    "url": "https://liagimpo.kr/llms.txt"
  },
  "tags": [
    {
      "name": "PublicContent",
      "description": "공개된 홈페이지 콘텐츠의 읽기 전용 검색과 조회"
    }
  ],
  "paths": {
    "/wp-json/wp/v2/search": {
      "get": {
        "operationId": "searchPublicContent",
        "summary": "공개 콘텐츠 검색",
        "description": "증상, 진료 항목 또는 병원 이용 안내와 관련된 공개 페이지와 글을 검색합니다.",
        "tags": ["PublicContent"],
        "security": [],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": true,
            "description": "검색어",
            "schema": {"type": "string", "minLength": 1},
            "example": "두근거림"
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "한 번에 반환할 결과 수",
            "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 10}
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "결과 페이지 번호",
            "schema": {"type": "integer", "minimum": 1, "default": 1}
          }
        ],
        "responses": {
          "200": {
            "description": "검색 결과",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/SearchResult"}
                }
              }
            }
          },
          "400": {"$ref": "#/components/responses/BadRequest"}
        }
      }
    },
    "/wp-json/wp/v2/pages": {
      "get": {
        "operationId": "listPublicPages",
        "summary": "공개 페이지 검색·목록 조회",
        "description": "발행된 공개 페이지를 검색하거나 페이지 단위로 조회합니다.",
        "tags": ["PublicContent"],
        "security": [],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "페이지 제목과 본문에서 찾을 검색어",
            "schema": {"type": "string"}
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "한 번에 반환할 페이지 수",
            "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 10}
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "결과 페이지 번호",
            "schema": {"type": "integer", "minimum": 1, "default": 1}
          }
        ],
        "responses": {
          "200": {
            "description": "공개 페이지 목록",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {"$ref": "#/components/schemas/PublicPage"}
                }
              }
            }
          },
          "400": {"$ref": "#/components/responses/BadRequest"}
        }
      }
    },
    "/wp-json/wp/v2/pages/{id}": {
      "get": {
        "operationId": "getPublicPage",
        "summary": "공개 페이지 한 건 조회",
        "description": "페이지 ID로 발행된 공개 페이지 한 건을 조회합니다.",
        "tags": ["PublicContent"],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "WordPress 페이지 ID",
            "schema": {"type": "integer", "minimum": 1},
            "example": 363
          }
        ],
        "responses": {
          "200": {
            "description": "공개 페이지",
            "content": {
              "application/json": {
                "schema": {"$ref": "#/components/schemas/PublicPage"}
              }
            }
          },
          "404": {"$ref": "#/components/responses/NotFound"}
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RenderedText": {
        "type": "object",
        "properties": {
          "rendered": {"type": "string"}
        },
        "required": ["rendered"]
      },
      "SearchResult": {
        "type": "object",
        "properties": {
          "id": {"type": "integer"},
          "title": {"type": "string"},
          "url": {"type": "string", "format": "uri"},
          "type": {"type": "string"},
          "subtype": {"type": "string"}
        },
        "required": ["id", "title", "url", "type", "subtype"]
      },
      "PublicPage": {
        "type": "object",
        "properties": {
          "id": {"type": "integer"},
          "date": {"type": "string"},
          "modified": {"type": "string"},
          "slug": {"type": "string"},
          "status": {"type": "string", "const": "publish"},
          "type": {"type": "string", "const": "page"},
          "link": {"type": "string", "format": "uri"},
          "title": {"$ref": "#/components/schemas/RenderedText"},
          "content": {"$ref": "#/components/schemas/RenderedText"}
        },
        "required": ["id", "slug", "status", "type", "link", "title", "content"]
      }
    },
    "responses": {
      "BadRequest": {
        "description": "요청 값이 올바르지 않음",
        "content": {
          "application/json": {
            "schema": {"type": "object"}
          }
        }
      },
      "NotFound": {
        "description": "공개 페이지를 찾을 수 없음",
        "content": {
          "application/json": {
            "schema": {"type": "object"}
          }
        }
      }
    }
  }
}
