{
  "openapi": "3.1.0",
  "info": {
    "title": "Medoo Website Documentation API",
    "summary": "Read-only machine-readable documentation for the Medoo PHP database framework.",
    "description": "This API exposes Medoo method documentation. It does not connect to a database or execute Medoo operations.",
    "version": "2.6.0",
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    }
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "servers": [
    {
      "url": "https://medoo.in",
      "description": "Production"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Reference",
      "description": "Medoo PHP method documentation."
    }
  ],
  "paths": {
    "/api/reference.json": {
      "get": {
        "operationId": "listApiReferences",
        "summary": "List documented Medoo methods",
        "tags": ["Reference"],
        "responses": {
          "200": {
            "description": "A list of method references.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReferenceCollection"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/reference/{name}.json": {
      "get": {
        "operationId": "getApiReference",
        "summary": "Get one Medoo method reference",
        "tags": ["Reference"],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Lowercase Medoo method name, such as select or insert.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested method reference.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Reference"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Error": {
        "description": "A structured error with a stable code and a recovery hint.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "ReferenceCollection": {
        "type": "object",
        "required": ["data", "meta"],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Reference"
            }
          },
          "meta": {
            "type": "object",
            "required": ["count"],
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      },
      "Reference": {
        "type": "object",
        "required": ["key", "name", "description", "signature", "documentation_url"],
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "signature": {
            "oneOf": [
              {"type": "string"},
              {"type": "array", "items": {"type": "string"}}
            ]
          },
          "parameters": {
            "description": "Parameter descriptions, grouped by overload when a method has multiple signatures.",
            "oneOf": [
              {"type": "object", "additionalProperties": {"type": "string"}},
              {"type": "array", "items": {"type": "object", "additionalProperties": {"type": "string"}}}
            ]
          },
          "returns": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "documentation_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message", "hint"],
            "properties": {
              "code": {"type": "string"},
              "message": {"type": "string"},
              "hint": {"type": "string"}
            }
          }
        }
      }
    }
  }
}
