{
  "openapi": "3.0.0",
  "info": {
    "title": "holiday-in-korea-api",
    "version": "25.11.1",
    "description": "대한민국의 공휴일 API"
  },
  "externalDocs": {
    "description": "ICS 파일 원본",
    "url": "https://holiday-ics.puter.us"
  },
  "servers": [
    {
      "url": "https://holiday-api.puter.us"
    }
  ],
  "paths": {
    "/holidays": {
      "get": {
        "summary": "특정 연도의 공휴일 목록 조회",
        "description": "특정 연도의 공휴일 목록을 반환합니다.<br>year 파라미터가 없으면 현재 연도를 사용합니다.",
        "tags": [
          "Holidays"
        ],
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "description": "조회할 연도 (기본값: 현재 연도)",
            "required": false,
            "schema": {
              "type": "integer",
              "example": 2026,
              "minimum": 2000,
              "maximum": 2100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "year": {
                      "type": "integer",
                      "example": 2025
                    },
                    "count": {
                      "type": "integer",
                      "example": 20
                    },
                    "holidays": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Holiday"
                      }
                    }
                  }
                },
                "example": {
                  "year": 2025,
                  "count": 20,
                  "holidays": [
                    {
                      "id": "20250101-새해 첫날",
                      "date": "2025-01-01",
                      "year": 2025,
                      "month": 1,
                      "day": 1,
                      "dayOfWeek": "수요일",
                      "name": "새해 첫날"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/holidays/years": {
      "get": {
        "summary": "사용 가능한 연도 목록 조회",
        "description": "ICS 파일에 포함된 모든 연도의 목록을 반환합니다.",
        "tags": [
          "Holidays"
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "years": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        2025,
                        2024,
                        2023,
                        2022
                      ]
                    },
                    "count": {
                      "type": "integer",
                      "example": 6
                    },
                    "range": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "integer",
                          "example": 2022
                        },
                        "to": {
                          "type": "integer",
                          "example": 2025
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/holidays/all": {
      "get": {
        "summary": "전체 공휴일 정보 조회",
        "description": "모든 연도의 공휴일 정보를 반환합니다.",
        "tags": [
          "Holidays"
        ],
        "responses": {
          "200": {
            "description": "성공",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalYears": {
                      "type": "integer",
                      "example": 6
                    },
                    "totalHolidays": {
                      "type": "integer",
                      "example": 102
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Holiday"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Holiday": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "공휴일 고유 ID",
            "example": "20250101-새해 첫날"
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "날짜 (YYYY-MM-DD)",
            "example": "2025-01-01"
          },
          "year": {
            "type": "integer",
            "description": "연도",
            "example": 2025
          },
          "month": {
            "type": "integer",
            "description": "월",
            "example": 1
          },
          "day": {
            "type": "integer",
            "description": "일",
            "example": 1
          },
          "dayOfWeek": {
            "type": "string",
            "description": "요일",
            "example": "수요일"
          },
          "name": {
            "type": "string",
            "description": "공휴일 이름",
            "example": "새해 첫날"
          }
        },
        "required": [
          "id",
          "date",
          "year",
          "month",
          "day",
          "dayOfWeek",
          "name"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "오류 메시지",
            "example": "Invalid year parameter"
          },
          "details": {
            "type": "string",
            "description": "상세 정보",
            "example": "Year must be between 2000 and 2100"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "Holidays",
      "description": "공휴일 정보 API"
    }
  ]
}