{
  "openapi": "3.0.3",
  "info": {
    "title": "AIONCLOUD Security Lab — Schema API",
    "version": "2.0.0",
    "description": "WAAP Schema Validation 테스트용 OAS 스펙. additionalProperties: false로 스펙 외 필드를 차단합니다."
  },
  "servers": [
    { "url": "/" }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [{ "BearerAuth": [] }],
  "paths": {
    "/api/schema/users/{id}": {
      "get": {
        "summary": "사용자 조회 (BOLA 테스트)",
        "operationId": "getUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": { "type": "integer" }
          }
        ],
        "responses": {
          "200": {
            "description": "사용자 정보",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": { "type": "integer" },
                    "username": { "type": "string" },
                    "name": { "type": "string" },
                    "role": { "type": "string" },
                    "email": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/schema/profile": {
      "get": {
        "summary": "내 프로필 조회 (Broken Auth 테스트)",
        "operationId": "getProfile",
        "responses": {
          "200": {
            "description": "프로필 정보",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": { "type": "string" },
                    "profile": {
                      "type": "object",
                      "properties": {
                        "userId": { "type": "integer" },
                        "role": { "type": "string" },
                        "username": { "type": "string" }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/schema/admin/users/list": {
      "get": {
        "summary": "전체 유저 목록 (Privilege Escalation 테스트)",
        "operationId": "adminUsersList",
        "responses": {
          "200": { "description": "유저 목록" }
        }
      }
    },
    "/api/schema/admin/config": {
      "get": {
        "summary": "서버 설정 조회 (Privilege Escalation 테스트)",
        "operationId": "adminConfig",
        "responses": {
          "200": { "description": "서버 설정" }
        }
      }
    },
    "/api/schema/users/{id}/update": {
      "put": {
        "summary": "사용자 정보 수정 (Mass Assignment 테스트)",
        "operationId": "updateUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": { "type": "integer" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "사용자 이름 (유일하게 허용된 필드)"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": { "description": "업데이트 결과" }
        }
      }
    },
    "/api/schema/echo": {
      "post": {
        "summary": "Echo API (Rate Limit / Schema 테스트)",
        "operationId": "echo",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "제목"
                  },
                  "message": {
                    "type": "string",
                    "description": "메시지 내용"
                  },
                  "tags": {
                    "type": "array",
                    "items": { "type": "string" },
                    "description": "태그 목록"
                  }
                },
                "required": ["title", "message"],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Echo 응답" },
          "429": { "description": "Rate Limit 초과" }
        }
      }
    }
  }
}
