{
    "openapi": "3.1.0",
    "info": {
        "title": "SearchAPI",
        "summary": "Prototype implementation of the SearchAPI",
        "description": "Searching Texts and return TextAPI related metadata",
        "license": {
            "name": "EUPL 1.2",
            "url": "https://eupl.eu/1.2/en/"
        },
        "version": "0.0.1"
    },
    "paths": {
        "/search": {
            "get": {
                "summary": "Search data",
                "description": "Search for data with filters or fulltext query.\n\n- **q**: fulltext query\n- **start**: start, may be number (e.g. '0') or tiebreaker (e.g. 'textgrid:1234.0'),\n             depending on implementation\n- **limit**: how much items to return (default to 10)\n- **facet**: facet\n- **facetLimit**: how much facets to return\n- **filter**: filter\n\n## TODO\n\n* /v0/ - api version in path\n* id prefix & resolving, bzw ids als urls?",
                "operationId": "search_search_get",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "title": "Q"
                        }
                    },
                    {
                        "name": "start",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "string"
                                }
                            ],
                            "default": 0,
                            "title": "Start"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "facet",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "title": "Facet"
                        }
                    },
                    {
                        "name": "facetLimit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "default": 0,
                            "title": "Facetlimit"
                        }
                    },
                    {
                        "name": "filter",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "title": "Filter"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SearchResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/index/{id}": {
            "get": {
                "summary": "Get metadata for specific ID",
                "description": "Retrieve metadata for a specific ID.\n\n- **id**: the ID to get metadata for\n\n## TODO\n\n* GND & tgrep as examples",
                "operationId": "getid_index__id__get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "title": "Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SearchResult"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/HTTPValidationError"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/search/info.json": {
            "get": {
                "summary": "Information on the endpoints features",
                "description": "Get Information on the endpoint or backends functionality",
                "operationId": "capabilities_search_info_json_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Capabilities"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/context.json": {
            "get": {
                "summary": "Jsonld Context",
                "operationId": "jsonld_context_context_json_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                }
            }
        },
        "/livenessProbe": {
            "get": {
                "summary": "Health",
                "description": "Endpoint for healthchecking the service.",
                "operationId": "health_livenessProbe_get",
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {
                            "application/json": {
                                "schema": {}
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Capabilities": {
                "properties": {
                    "facets": {
                        "items": {
                            "$ref": "#/components/schemas/FacetDescription"
                        },
                        "type": "array",
                        "title": "Facets"
                    },
                    "syntax": {
                        "$ref": "#/components/schemas/Syntax"
                    }
                },
                "type": "object",
                "required": [
                    "facets",
                    "syntax"
                ],
                "title": "Capabilities"
            },
            "Facet": {
                "properties": {
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "label": {
                        "type": "string",
                        "title": "Label"
                    },
                    "count": {
                        "type": "integer",
                        "title": "Count"
                    }
                },
                "type": "object",
                "required": [
                    "id",
                    "label",
                    "count"
                ],
                "title": "Facet"
            },
            "FacetDescription": {
                "properties": {
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "label": {
                        "type": "string",
                        "title": "Label"
                    },
                    "type": {
                        "type": "string",
                        "title": "Type"
                    }
                },
                "type": "object",
                "required": [
                    "id",
                    "label",
                    "type"
                ],
                "title": "FacetDescription"
            },
            "FacetResult": {
                "properties": {
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "label": {
                        "type": "string",
                        "title": "Label"
                    },
                    "facets": {
                        "items": {
                            "$ref": "#/components/schemas/Facet"
                        },
                        "type": "array",
                        "title": "Facets",
                        "default": []
                    }
                },
                "type": "object",
                "required": [
                    "id",
                    "label"
                ],
                "title": "FacetResult"
            },
            "HTTPValidationError": {
                "properties": {
                    "detail": {
                        "items": {
                            "$ref": "#/components/schemas/ValidationError"
                        },
                        "type": "array",
                        "title": "Detail"
                    }
                },
                "type": "object",
                "title": "HTTPValidationError"
            },
            "Kwic": {
                "properties": {
                    "left": {
                        "type": "string",
                        "title": "Left"
                    },
                    "match": {
                        "type": "string",
                        "title": "Match"
                    },
                    "right": {
                        "type": "string",
                        "title": "Right"
                    }
                },
                "type": "object",
                "required": [
                    "left",
                    "match",
                    "right"
                ],
                "title": "Kwic"
            },
            "SearchResponse": {
                "properties": {
                    "@context": {
                        "type": "string",
                        "title": "@Context",
                        "default": "https://gitlab.gwdg.de/subugoe/searchapi/sandbox/-/raw/main/src/searchapi/context.json"
                    },
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "type": {
                        "type": "string",
                        "title": "Type",
                        "default": "SearchResponse"
                    },
                    "total": {
                        "type": "integer",
                        "title": "Total"
                    },
                    "items": {
                        "items": {
                            "$ref": "#/components/schemas/SearchResult"
                        },
                        "type": "array",
                        "title": "Items",
                        "default": []
                    },
                    "facetgroups": {
                        "items": {
                            "$ref": "#/components/schemas/FacetResult"
                        },
                        "type": "array",
                        "title": "Facetgroups",
                        "default": []
                    },
                    "service": {
                        "items": {
                            "$ref": "#/components/schemas/Service"
                        },
                        "type": "array",
                        "title": "Service",
                        "default": []
                    }
                },
                "type": "object",
                "required": [
                    "id",
                    "total"
                ],
                "title": "SearchResponse"
            },
            "SearchResult": {
                "properties": {
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "label": {
                        "type": "string",
                        "title": "Label"
                    },
                    "kwic": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/Kwic"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Kwic"
                    },
                    "document": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Document"
                    }
                },
                "type": "object",
                "required": [
                    "id",
                    "label"
                ],
                "title": "SearchResult"
            },
            "Service": {
                "properties": {
                    "id": {
                        "type": "string",
                        "title": "Id"
                    },
                    "type": {
                        "type": "string",
                        "title": "Type"
                    }
                },
                "type": "object",
                "required": [
                    "id",
                    "type"
                ],
                "title": "Service"
            },
            "Syntax": {
                "properties": {
                    "type": {
                        "type": "string",
                        "title": "Type"
                    },
                    "doc": {
                        "type": "string",
                        "title": "Doc"
                    },
                    "exceptions": {
                        "items": {
                            "type": "string"
                        },
                        "type": "array",
                        "title": "Exceptions"
                    }
                },
                "type": "object",
                "required": [
                    "type",
                    "doc",
                    "exceptions"
                ],
                "title": "Syntax"
            },
            "ValidationError": {
                "properties": {
                    "loc": {
                        "items": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "integer"
                                }
                            ]
                        },
                        "type": "array",
                        "title": "Location"
                    },
                    "msg": {
                        "type": "string",
                        "title": "Message"
                    },
                    "type": {
                        "type": "string",
                        "title": "Error Type"
                    }
                },
                "type": "object",
                "required": [
                    "loc",
                    "msg",
                    "type"
                ],
                "title": "ValidationError"
            }
        }
    }
}