{
  "openapi": "3.1.0",
  "info": {
    "title": "Mimir Auditor API",
    "version": "1.0.0",
    "description": "Read-only status API for Mimir NAS."
  },
  "servers": [
    {
      "url": "https://auditor.fisher.me.uk"
    }
  ],
  "components": {
    "schemas": {},
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Get Auditor health status",
        "responses": {
          "200": {
            "description": "Health status"
          }
        }
      }
    },
    "/api/summary": {
      "get": {
        "operationId": "getSummary",
        "summary": "Get NAS summary",
        "responses": {
          "200": {
            "description": "NAS summary"
          }
        }
      }
    },
    "/api/problems": {
      "get": {
        "operationId": "getProblems",
        "summary": "Get detected NAS problems and warnings",
        "responses": {
          "200": {
            "description": "Problem report"
          }
        }
      }
    },
    "/api/homelab": {
      "get": {
        "operationId": "getHomelabStatus",
        "summary": "Get human-friendly homelab status",
        "responses": {
          "200": {
            "description": "Homelab status"
          }
        }
      }
    },
    "/api/files": {
      "get": {
        "operationId": "listEditableFiles",
        "summary": "List whitelisted editable/source files",
        "responses": {
          "200": {
            "description": "Whitelisted files"
          }
        }
      }
    },
    "/api/files/{file_id}": {
      "get": {
        "operationId": "readEditableFile",
        "summary": "Read one whitelisted editable/source file in numbered chunks",
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "weasley-clock-app",
                "mimir-auditor-server",
                "gmail-magnet-dropper-app",
                "gmail-magnet-dropper-main"
              ]
            }
          },
          {
            "name": "start_line",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "First line number to read, starting at 1"
          },
          {
            "name": "max_lines",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 220,
              "maximum": 300
            },
            "description": "Maximum number of lines to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Numbered file content chunk"
          }
        }
      }
    },
    "/api/containers/summary": {
      "get": {
        "operationId": "getContainerSummary",
        "summary": "Get Docker container summary",
        "responses": {
          "200": {
            "description": "Container summary"
          }
        }
      }
    }
  }
}