{
  "openapi": "3.1.0",
  "info": {
    "title": "Panel Tool Lab",
    "version": "1.0.0",
    "description": "Endpoints de teste pra plugar como TOOL no Virtues Panel"
  },
  "servers": [
    {
      "url": "https://tool-lab.virtues.cc"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/api/time": {
      "get": {
        "operationId": "getTime",
        "summary": "Hora atual em timezone",
        "parameters": [
          {
            "name": "tz",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "IANA timezone, default America/Sao_Paulo"
          }
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/calc": {
      "post": {
        "operationId": "calculate",
        "summary": "Avalia expressao aritmetica segura (+ - * / parenteses)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "expression"
                ],
                "properties": {
                  "expression": {
                    "type": "string",
                    "example": "(2+3)*4"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/dice": {
      "post": {
        "operationId": "rollDice",
        "summary": "Rola dados",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sides": {
                    "type": "integer",
                    "default": 6
                  },
                  "count": {
                    "type": "integer",
                    "default": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/notes": {
      "get": {
        "operationId": "listNotes",
        "summary": "Lista notas salvas",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      },
      "post": {
        "operationId": "createNote",
        "summary": "Cria nota",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "created"
          }
        }
      }
    },
    "/api/notes/{id}": {
      "delete": {
        "operationId": "deleteNote",
        "summary": "Remove nota por id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/echo": {
      "post": {
        "operationId": "echo",
        "summary": "Devolve o body enviado (debug)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/api/weather": {
      "get": {
        "operationId": "getWeather",
        "summary": "Clima simulado (deterministico, offline) por cidade",
        "parameters": [
          {
            "name": "city",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    }
  }
}