{
  "openapi": "3.1.1",
  "info": {
    "title": "Onepard Public Search API",
    "version": "1.0.0",
    "description": "Find excerpts from Onepard’s public pages."
  },
  "servers": [{ "url": "https://onepard.com" }],
  "externalDocs": { "url": "https://onepard.com/docs#public-search" },
  "paths": {
    "/api/v1/search": {
      "get": {
        "operationId": "searchOnepard",
        "summary": "Search Onepard’s public pages",
        "parameters": [{
          "name": "q",
          "in": "query",
          "description": "One non-empty keyword or question.",
          "required": true,
          "schema": { "type": "string" },
          "example": "pricing"
        }],
        "responses": {
          "200": {
            "description": "Search results and source links in Markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["markdown"],
                  "properties": { "markdown": { "type": "string" } }
                }
              }
            }
          },
          "400": {
            "description": "The query is missing, blank, or repeated.",
            "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }
          },
          "429": {
            "description": "The search service is rate limiting requests.",
            "headers": { "Retry-After": { "description": "Retry timing when supplied by the search service.", "schema": { "type": "string" } } },
            "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }
          },
          "502": {
            "description": "The search service could not return results.",
            "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "required": ["type", "title", "status", "code", "detail", "resolution"],
        "properties": {
          "type": { "type": "string", "format": "uri-reference" },
          "title": { "type": "string" },
          "status": { "type": "integer", "minimum": 400, "maximum": 599 },
          "code": { "type": "string" },
          "detail": { "type": "string" },
          "resolution": { "type": "string" }
        }
      }
    }
  }
}
