{
  "openapi": "3.1.0",
  "info": {
    "title": "ServaDiscord Docs API",
    "version": "1.0.0",
    "description": "Public search endpoint of the ServaDiscord documentation site. The product API is documented at https://www.servadiscord.com/openapi.json. Versioning: the product API is versioned in the URL path (/api/v1); breaking changes ship under a new path and deprecations are signalled with Deprecation and Sunset headers plus the changelog, with at least 6 months notice. See https://docs.servadiscord.com/developers."
  },
  "servers": [
    {
      "url": "https://docs.servadiscord.com"
    }
  ],
  "paths": {
    "/api/search": {
      "get": {
        "operationId": "searchDocs",
        "summary": "Full-text search across the documentation",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching pages and headings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "page",
                          "heading",
                          "text"
                        ]
                      },
                      "content": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Error": {
        "description": "Structured error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "code",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "examples": [
              "not_found"
            ]
          },
          "message": {
            "type": "string"
          },
          "hint": {
            "type": "string",
            "description": "How to resolve the error"
          }
        }
      }
    }
  }
}
