{
  "openapi": "3.0.0",
  "info": {
    "title": "HMS API",
    "description": "API for third-party developers to build apps for the Hospital Management System.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "http://localhost:8000/api/v1",
      "description": "Local development server"
    }
  ],
  "paths": {
    "/login": {
      "post": {
        "summary": "Authenticate user",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": { "type": "string" },
                  "password": { "type": "string" },
                  "device_name": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful login",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": { "type": "string" },
                    "user": { "type": "object" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/patients": {
      "get": {
        "summary": "List patients",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "List of patients" }
        }
      }
    },
    "/doctors": {
      "get": {
        "summary": "List doctors",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "List of doctors" }
        }
      }
    },
    "/appointments": {
      "get": {
        "summary": "List appointments",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "List of appointments" }
        }
      }
    },
    "/lab-results": {
      "get": {
        "summary": "List lab results",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "List of lab results" }
        }
      }
    },
    "/admissions": {
      "get": {
        "summary": "List admissions",
        "security": [{ "bearerAuth": [] }],
        "responses": {
          "200": { "description": "List of admissions" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
