{
  "openapi": "3.0.0",
  "servers": [
    {
      "description": "SwaggerHub API Auto Mocking",
      "url": "https://virtserver.swaggerhub.com/nuclia/nucliadb/1.0.0"
    },
    {
      "description": "SwaggerHub API Auto Mocking",
      "url": "https://europe1.stashify.cloud/1.0.0"
    }
  ],
  "info": {
    "version": "1.0.0",
    "title": "nucliadb Search API",
    "description": "This is an example of using OAuth2 Application Flow in a specification to describe security to your API."
  },
  "security": [
    {
      "application": [
        "read",
        "write"
      ]
    }
  ],
  "paths": {
    "/kb/{kb_uuid}/search": {
      "get": {
        "parameters": [
          {
            "in": "path",
            "name": "kb_uuid",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "UUID of the knowledgebox"
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Text query. It can be with quotes to force keyword search on that elements."
          },
          {
            "in": "query",
            "name": "filter",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Filter query. It should be a list of tags to filter. It can be a range query."
          },
          {
            "in": "query",
            "name": "order",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Order query"
          },
          {
            "in": "query",
            "name": "v",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "BASE64 vector encoding"
          },
          {
            "in": "query",
            "name": "rid",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Resource search"
          },
          {
            "in": "query",
            "name": "disable",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "paragraph",
                  "semantic",
                  "document",
                  "relations"
                ]
              }
            },
            "required": false,
            "description": "Disable paragraph, semantic, document, relations"
          },
          {
            "in": "query",
            "name": "enable",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "ask"
                ]
              }
            },
            "required": false,
            "description": "Disable paragraph, semantic, document, relations"
          }
        ],
        "summary": "Main search query",
        "description": "This is an example operation to show how security is applied to the call.",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "KnowledgeBox": {
        "title": "A knowledge box at nucliadb",
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "icon": {
            "type": "string",
            "description": "BASE64 Image"
          }
        }
      },
      "Resource": {
        "title": "A Resource at nucliadb",
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "uri": {
                  "type": "string"
                },
                "headers": {
                  "type": "object"
                }
              }
            }
          },
          "block": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "blocks": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "text": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "labels": {
            "type": "object"
          },
          "entities": {
            "type": "object"
          },
          "paragraphs": {
            "type": "object"
          },
          "related": {
            "type": "object"
          }
        }
      }
    },
    "securitySchemes": {
      "application": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://auth.stashify.cloud/oauth/token",
            "tokenUrl": "https://auth.stashify.cloud/oauth/token",
            "refreshUrl": "https://auth.stashify.cloud/oauth/token",
            "scopes": {
              "write": "allows modifying resources",
              "read": "allows reading resources"
            }
          }
        }
      }
    }
  }
}