# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
openapi: 3.1.1
info:
  title: Lance Namespace Specification
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
  description: |
    This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts:

    The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define
    the request and response shape for each operation in a Lance Namespace across all implementations.
    See https://lance.org/format/namespace/operations for more details.

    The `servers`, `security`, `paths`, `components/parameters` sections are for the
    Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets.
    See https://lance.org/format/namespace/rest for more details.
servers:
  # A concrete URL must come first. Documentation renderers and API consoles
  # substitute no variables when every server is templated, so they cannot build
  # a request URL and render an error in place of each endpoint's code samples.
  - url: http://localhost:2333
    description: Default local server
  - url: "{scheme}://{host}:{port}/{basePath}"
    description: Generic server URL with all parts configurable
    variables:
      scheme:
        default: http
      host:
        default: localhost
      port:
        default: "2333"
      basePath:
        default: ""
  - url: "{scheme}://{host}/{basePath}"
    description: Server URL when the port can be inferred from the scheme
    variables:
      scheme:
        default: http
      host:
        default: localhost
      basePath:
        default: ""

tags:
  - name: Namespace
    description: |
      Operations that are related to a namespace
  - name: Table
    description: |
      Operations that are related to a table
  - name: Index
    description: |
      Operations that are related to an index
  - name: Tag
    description: |
      Operations that are related to tags
  - name: Transaction
    description: |
      Operations that are related to a transaction
  - name: Metadata
    description: |
      Operations that only interact with object metadata and should be computationally lightweight
  - name: Data
    description: |
      Operations that interact with object data and might be computationally intensive

security:
  - OAuth2: []
  - BearerAuth: []
  - ApiKeyAuth: []

paths:
  # Namespace APIs

  /v1/namespace/{id}/create:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Namespace
        - Metadata
      summary: Create a new namespace
      operationId: CreateNamespace
      description: |
        Create new namespace `id`.

        During the creation process, the implementation may modify user-provided `properties`,
        such as adding additional properties like `created_at` to user-provided properties,
        omitting any specific property, or performing actions based on any property value.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateNamespaceRequest"
      responses:
        200:
          $ref: "#/components/responses/CreateNamespaceResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        406:
          $ref: "#/components/responses/UnsupportedOperationErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/namespace/{id}/list:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/page_token"
      - $ref: "#/components/parameters/limit"
    get:
      tags:
        - Namespace
        - Metadata
      summary: List namespaces
      operationId: ListNamespaces
      description: |
        List all child namespace names of the parent namespace `id`.

        REST NAMESPACE ONLY
        REST namespace uses GET to perform this operation without a request body.
        It passes in the `ListNamespacesRequest` information in the following way:
        - `id`: pass through path parameter of the same name
        - `page_token`: pass through query parameter of the same name
        - `limit`: pass through query parameter of the same name
      responses:
        200:
          $ref: "#/components/responses/ListNamespacesResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        406:
          $ref: "#/components/responses/UnsupportedOperationErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/namespace/{id}/describe:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Namespace
        - Metadata
      summary: Describe a namespace
      operationId: DescribeNamespace
      description: |
        Describe the detailed information for namespace `id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DescribeNamespaceRequest"
      responses:
        200:
          $ref: "#/components/responses/DescribeNamespaceResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/namespace/{id}/drop:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Namespace
        - Metadata
      summary: Drop a namespace
      operationId: DropNamespace
      description: |
        Drop namespace `id` from its parent namespace.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DropNamespaceRequest"
      responses:
        200:
          $ref: "#/components/responses/DropNamespaceResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/namespace/{id}/exists:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Namespace
        - Metadata
      summary: Check if a namespace exists
      operationId: NamespaceExists
      description: |
        Check if namespace `id` exists.

        This operation must behave exactly like the DescribeNamespace API,
        except it does not contain a response body.

        REST NAMESPACE ONLY
        REST namespace conveys the result through the HTTP status code with no response body.
        The REST response maps to the `NamespaceExistsResponse` model as follows:
        - a `200` response means the namespace exists; a `404` response means it does not
        - response headers map to `context` via the `header.` prefix (see the `Context` schema)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NamespaceExistsRequest"
      responses:
        200:
          description: Success, no content
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/namespace/{id}/table/list:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/page_token"
      - $ref: "#/components/parameters/limit"
      - $ref: "#/components/parameters/include_declared"
    get:
      tags:
        - Namespace
        - Table
        - Metadata
      summary: List tables in a namespace
      operationId: ListTables
      description: |
        List all child table names of the parent namespace `id`.

        REST NAMESPACE ONLY
        REST namespace uses GET to perform this operation without a request body.
        It passes in the `ListTablesRequest` information in the following way:
        - `id`: pass through path parameter of the same name
        - `page_token`: pass through query parameter of the same name
        - `limit`: pass through query parameter of the same name
        - `include_declared`: pass through query parameter of the same name
      responses:
        200:
          $ref: "#/components/responses/ListTablesResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        406:
          $ref: "#/components/responses/UnsupportedOperationErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  # Table Metadata APIs

  /v1/table:
    get:
      tags:
        - Table
      summary: List all tables
      operationId: ListAllTables
      description: |
        List all tables across all namespaces.

        REST NAMESPACE ONLY
        REST namespace uses GET to perform this operation without a request body.
        It passes in the `ListAllTablesRequest` information in the following way:
        - `page_token`: pass through query parameter of the same name
        - `limit`: pass through query parameter of the same name
        - `delimiter`: pass through query parameter of the same name
        - `include_declared`: pass through query parameter of the same name
      parameters:
        - $ref: "#/components/parameters/delimiter"
        - $ref: "#/components/parameters/page_token"
        - $ref: "#/components/parameters/limit"
        - $ref: "#/components/parameters/include_declared"
      responses:
        200:
          $ref: "#/components/responses/ListTablesResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/register:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Register a table to a namespace
      operationId: RegisterTable
      description: |
        Register an existing table at a given storage location as `id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RegisterTableRequest"
      responses:
        200:
          $ref: "#/components/responses/RegisterTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        406:
          $ref: "#/components/responses/UnsupportedOperationErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/describe:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/with_table_uri"
      - $ref: "#/components/parameters/load_detailed_metadata"
      - $ref: "#/components/parameters/check_declared"
    post:
      tags:
        - Table
        - Metadata
      summary: Describe information of a table
      operationId: DescribeTable
      description: |
        Describe the detailed information for table `id`.

        REST NAMESPACE ONLY
        REST namespace passes `with_table_uri`, `load_detailed_metadata`, and `check_declared` as query parameters instead of in the request body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DescribeTableRequest"
      responses:
        200:
          $ref: "#/components/responses/DescribeTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/exists:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Check if a table exists
      operationId: TableExists
      description: |
        Check if table `id` exists.

        This operation should behave exactly like DescribeTable,
        except it does not contain a response body.

        REST NAMESPACE ONLY
        REST namespace conveys the result through the HTTP status code with no response body.
        The REST response maps to the `TableExistsResponse` model as follows:
        - a `200` response means the table exists; a `404` response means it does not
        - response headers map to `context` via the `header.` prefix (see the `Context` schema)

        For DirectoryNamespace implementation, a table exists if either:
        - The table has Lance data versions (regular table created with CreateTable)
        - A `.lance-reserved` file exists in the table directory (declared table created with DeclareTable)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TableExistsRequest"
      responses:
        200:
          description: Success, no content
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/drop:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Drop a table
      operationId: DropTable
      description: |
        Drop table `id` and delete its data.

        REST NAMESPACE ONLY
        REST namespace does not use a request body for this operation.
        The `DropTableRequest` information is passed in the following way:
        - `id`: pass through path parameter of the same name
      responses:
        200:
          $ref: "#/components/responses/DropTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/deregister:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Deregister a table
      operationId: DeregisterTable
      description: |
        Deregister table `id` from its namespace.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeregisterTableRequest"
      responses:
        200:
          $ref: "#/components/responses/DeregisterTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/restore:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Restore table to a specific version
      operationId: RestoreTable
      description: |
        Restore table `id` to a specific version.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RestoreTableRequest"
      responses:
        200:
          $ref: "#/components/responses/RestoreTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/rename:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Rename a table
      operationId: RenameTable
      description: |
        Rename table `id` to a new name.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RenameTableRequest"
      responses:
        200:
          $ref: "#/components/responses/RenameTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/schema_metadata/update:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/branch"
    post:
      tags:
        - Table
        - Metadata
      summary: Update table schema metadata
      operationId: UpdateTableSchemaMetadata
      description: |
        Replace the schema metadata for table `id` with the provided key-value pairs.

        REST NAMESPACE ONLY
        REST namespace uses a direct object (map of string to string) as both request and response body
        instead of the wrapped `UpdateTableSchemaMetadataRequest` and `UpdateTableSchemaMetadataResponse`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                type: string
              description: Schema metadata key-value pairs
      responses:
        200:
          description: Schema metadata update result
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
                description: The updated schema metadata
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/version/list:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/branch"
      - $ref: "#/components/parameters/page_token"
      - $ref: "#/components/parameters/limit"
      - name: descending
        in: query
        description: |
          When true, versions are guaranteed to be returned in descending order (latest to oldest).
          When false or not specified, the ordering is implementation-defined.
        required: false
        schema:
          type: boolean
    post:
      tags:
        - Table
        - Metadata
      summary: List all versions of a table
      operationId: ListTableVersions
      description: |
        List all versions (commits) of table `id` with their metadata.

        Use `descending=true` to guarantee versions are returned in descending order (latest to oldest).
        Otherwise, the ordering is implementation-defined.

        REST NAMESPACE ONLY
        REST namespace does not use a request body for this operation.
        The `ListTableVersionsRequest` information is passed in the following way:
        - `id`: pass through path parameter of the same name
        - `page_token`: pass through query parameter of the same name
        - `limit`: pass through query parameter of the same name
        - `descending`: pass through query parameter of the same name
      responses:
        200:
          $ref: "#/components/responses/ListTableVersionsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/version/create:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Create a new table version
      operationId: CreateTableVersion
      description: |
        Create a new version entry for table `id`.

        This operation supports `put_if_not_exists` semantics.
        The operation will fail with 409 Conflict if the version already exists.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTableVersionRequest"
      responses:
        200:
          $ref: "#/components/responses/CreateTableVersionResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/version/describe:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Describe a specific table version
      operationId: DescribeTableVersion
      description: |
        Describe the detailed information for a specific version of table `id`.

        Returns the manifest path and metadata for the specified version.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DescribeTableVersionRequest"
      responses:
        200:
          $ref: "#/components/responses/DescribeTableVersionResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/version/delete:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Delete table version records
      operationId: BatchDeleteTableVersions
      description: |
        Delete version metadata records for table `id`.

        This operation deletes version tracking records, NOT the actual table data.
        It supports deleting ranges of versions for efficient bulk cleanup.

        Special range values:
        - `start_version: 0` with `end_version: -1` means delete ALL version records
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BatchDeleteTableVersionsRequest"
      responses:
        200:
          $ref: "#/components/responses/BatchDeleteTableVersionsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/version/batch-create:
    parameters:
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Atomically create versions for multiple tables
      operationId: BatchCreateTableVersions
      description: |
        Atomically create new version entries for multiple tables.

        This operation is atomic: either all table versions are created successfully,
        or none are created. If any version creation fails (e.g., due to conflict),
        the entire batch operation fails.

        Each entry in the request specifies the table identifier and version details.
        This supports `put_if_not_exists` semantics for each version entry.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BatchCreateTableVersionsRequest"
      responses:
        200:
          $ref: "#/components/responses/BatchCreateTableVersionsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/batch-commit:
    parameters:
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
        - Transaction
      summary: Atomically commit a batch of mixed table operations
      operationId: BatchCommitTables
      description: |
        Atomically commit a batch of table operations. This is a generalized version
        of `BatchCreateTableVersions` that supports mixed operation types within a
        single atomic transaction at the metadata layer.

        Supported operation types:
        - `DeclareTable`: Declare (reserve) a new table
        - `CreateTableVersion`: Create a new version entry for a table
        - `DeleteTableVersions`: Delete version ranges from a table
        - `DeregisterTable`: Deregister (soft-delete) a table

        All operations are committed atomically: either all succeed or none are applied.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BatchCommitTablesRequest"
      responses:
        200:
          $ref: "#/components/responses/BatchCommitTablesResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/alter_columns:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Modify existing columns
      operationId: AlterTableAlterColumns
      description: |
        Modify existing columns in table `id`, such as renaming or changing data types.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AlterTableAlterColumnsRequest"
      responses:
        200:
          $ref: "#/components/responses/AlterTableAlterColumnsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/update_field_metadata:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Update per-field metadata
      operationId: UpdateFieldMetadata
      description: |
        Update the Arrow field (column) metadata for table `id`.

        Each entry targets a field by `path` and merges the provided key-value
        pairs into that field's existing metadata, or replaces it when `replace`
        is true. A null metadata value deletes that key.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateFieldMetadataRequest"
      responses:
        200:
          $ref: "#/components/responses/UpdateFieldMetadataResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/drop_columns:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Remove columns from table
      operationId: AlterTableDropColumns
      description: |
        Remove specified columns from table `id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AlterTableDropColumnsRequest"
      responses:
        200:
          $ref: "#/components/responses/AlterTableDropColumnsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/stats:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Get table statistics
      operationId: GetTableStats
      description: |
        Get statistics for table `id`, including row counts, data sizes, and column statistics.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetTableStatsRequest"
      responses:
        200:
          $ref: "#/components/responses/GetTableStatsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  # Table Data APIs

  /v1/table/{id}/insert:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/branch"
      - name: mode
        in: query
        description: |
          How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are:
          - Append (default): insert data to the existing table
          - Overwrite: remove all data in the table and then insert data to it
        required: false
        schema:
          type: string
          default: append
    post:
      tags:
        - Table
        - Data
      summary: Insert records into a table
      operationId: InsertIntoTable
      description: |
        Insert new records into table `id`.

        For tables that have been declared but not yet created on storage
        (is_only_declared=true), this operation will create the table with
        the provided data.

        REST NAMESPACE ONLY
        REST namespace uses Arrow IPC stream as the request body.
        It passes in the `InsertIntoTableRequest` information in the following way:
        - `id`: pass through path parameter of the same name
        - `mode`: pass through query parameter of the same name
      requestBody:
        description: Arrow IPC stream containing the records to insert
        content:
          application/vnd.apache.arrow.stream:
            schema:
              type: string
              format: binary
        required: true
      responses:
        200:
          $ref: "#/components/responses/InsertIntoTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/merge_insert:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/branch"
      - name: "on"
        in: query
        description: Lance field paths to use for matching rows. Repeat the parameter once per field to match on a composite key; a row matches only when every listed field is equal. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
        required: true
        style: form
        explode: true
        schema:
          type: array
          minItems: 1
          items:
            type: string
            minLength: 1
      - name: "when_matched_update_all"
        in: query
        description: Update all columns when rows match
        required: false
        schema:
          type: boolean
          default: false
      - name: "when_matched_update_all_filt"
        in: query
        description: "The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled."
        required: false
        schema:
          type: string
      - name: "when_not_matched_insert_all"
        in: query
        description: Insert all columns when rows don't match
        required: false
        schema:
          type: boolean
          default: false
      - name: "when_not_matched_by_source_delete"
        in: query
        description: Delete all rows from target table that don't match a row in the source table
        required: false
        schema:
          type: boolean
          default: false
      - name: "when_not_matched_by_source_delete_filt"
        in: query
        description: "Delete rows from the target table if there is no match AND the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled."
        schema:
          type: string
      - name: "timeout"
        in: query
        description: Timeout for the operation (e.g., "30s", "5m")
        required: false
        schema:
          type: string
      - name: "use_index"
        in: query
        description: Whether to use index for matching rows
        required: false
        schema:
          type: boolean
          default: false
    post:
      tags:
        - Table
        - Data
      summary: Merge insert (upsert) records into a table
      operationId: MergeInsertIntoTable
      description: |
        Performs a merge insert (upsert) operation on table `id`.
        This operation updates existing rows
        based on one or more matching columns and inserts new rows that don't match.
        It returns the number of rows inserted and updated.

        For tables that have been declared but not yet created on storage
        (is_only_declared=true), this operation will create the table with
        the provided data (since there are no existing rows to merge with).

        REST NAMESPACE ONLY
        REST namespace uses Arrow IPC stream as the request body.
        It passes in the `MergeInsertIntoTableRequest` information in the following way:
        - `id`: pass through path parameter of the same name
        - `on`: pass through query parameter of the same name, repeated once per field path
        - `when_matched_update_all`: pass through query parameter of the same name
        - `when_matched_update_all_filt`: pass through query parameter of the same name
        - `when_not_matched_insert_all`: pass through query parameter of the same name
        - `when_not_matched_by_source_delete`: pass through query parameter of the same name
        - `when_not_matched_by_source_delete_filt`: pass through query parameter of the same name
      requestBody:
        description: Arrow IPC stream containing the records to merge
        content:
          application/vnd.apache.arrow.stream:
            schema:
              type: string
              format: binary
        required: true
      responses:
        200:
          $ref: "#/components/responses/MergeInsertIntoTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/update:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Data
      summary: Update rows in a table
      operationId: UpdateTable
      description: |
        Update existing rows in table `id`.
      requestBody:
        description: Update request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTableRequest"
        required: true
      responses:
        200:
          $ref: "#/components/responses/UpdateTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/delete:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Data
      summary: Delete rows from a table
      operationId: DeleteFromTable
      description: |
        Delete rows from table `id`.
      requestBody:
        description: Delete request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeleteFromTableRequest"
        required: true
      responses:
        200:
          $ref: "#/components/responses/DeleteFromTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/query:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Data
      summary: Query a table
      operationId: QueryTable
      description: |
        Query table `id` with vector search, full text search and optional SQL filtering.
        Returns results in Arrow IPC file or stream format.

        REST NAMESPACE ONLY
        REST namespace returns the response as Arrow IPC file binary data
        instead of the `QueryTableResponse` JSON object.
        The REST response maps to the `QueryTableResponse` model as follows:
        - the Arrow IPC file binary body maps to `data`
        - response headers map to `context` via the `header.` prefix (see the `Context` schema)
      requestBody:
        description: Query request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QueryTableRequest"
        required: true
      responses:
        200:
          $ref: "#/components/responses/QueryTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/count_rows:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Data
      summary: Count rows in a table
      operationId: CountTableRows
      description: |
        Count the number of rows in table `id`

        REST NAMESPACE ONLY
        REST namespace returns the response as a plain integer
        instead of the `CountTableRowsResponse` JSON object.
        The REST response maps to the `CountTableRowsResponse` model as follows:
        - the integer response body maps to `count`
        - response headers map to `context` via the `header.` prefix (see the `Context` schema)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CountTableRowsRequest"
      responses:
        200:
          $ref: "#/components/responses/CountTableRowsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/create:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - name: "mode"
        in: query
        required: false
        schema:
          type: string
      - name: "properties"
        in: query
        required: false
        schema:
          type: string
        description: |
          Business logic properties managed by the namespace implementation outside Lance context.
          The map is translated to a single JSON-encoded query parameter such as
          `properties={"user":"alice","team":"eng"}`.
      - name: "storage_options"
        in: query
        required: false
        schema:
          type: string
        description: |
          Storage options that configure overrides for writing table data and metadata during
          table creation. These are passed to Lance for the write path.
          The map is translated to a single JSON-encoded query parameter such as
          `storage_options={"aws_region":"us-east-1","timeout":"30s"}`.
    post:
      tags:
        - Table
        - Data
      summary: Create a table with the given name
      operationId: CreateTable
      description: |
        Create table `id` in the namespace with the given data in Arrow IPC stream.

        The schema of the Arrow IPC stream is used as the table schema.
        If the stream is empty, the API creates a new empty table.

        REST NAMESPACE ONLY
        REST namespace uses Arrow IPC stream as the request body.
        It passes in the `CreateTableRequest` information in the following way:
        - `id`: pass through path parameter of the same name
        - `mode`: pass through query parameter of the same name
        - `properties`: serialize as a single JSON-encoded query parameter such as
          `properties={"user":"alice","team":"eng"}`; these are business logic properties
          managed by the namespace implementation outside Lance context
        - `storage_options`: serialize as a single JSON-encoded query parameter such as
          `storage_options={"aws_region":"us-east-1","timeout":"30s"}`; these configure
          write-time overrides for data and metadata written during table creation
      requestBody:
        description: Arrow IPC data
        content:
          application/vnd.apache.arrow.stream:
            schema:
              type: string
              format: binary
        required: true
      responses:
        200:
          $ref: "#/components/responses/CreateTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/explain_plan:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Data
      summary: Get query execution plan explanation
      operationId: ExplainTableQueryPlan
      description: |
        Get the query execution plan for a query against table `id`.
        Returns a human-readable explanation of how the query will be executed.

        REST NAMESPACE ONLY
        REST namespace returns the response as a plain string
        instead of the `ExplainTableQueryPlanResponse` JSON object.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ExplainTableQueryPlanRequest"
      responses:
        200:
          $ref: "#/components/responses/ExplainTableQueryPlanResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/analyze_plan:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Data
      summary: Analyze query execution plan
      operationId: AnalyzeTableQueryPlan
      description: |
        Analyze the query execution plan for a query against table `id`.
        Returns detailed statistics and analysis of the query execution plan.

        REST NAMESPACE ONLY
        REST namespace returns the response as a plain string
        instead of the `AnalyzeTableQueryPlanResponse` JSON object.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AnalyzeTableQueryPlanRequest"
      responses:
        200:
          $ref: "#/components/responses/AnalyzeTableQueryPlanResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/add_columns:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Data
      summary: Add new columns to table schema
      operationId: AlterTableAddColumns
      description: |
        Add new columns to table `id` using SQL expressions or default values.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AlterTableAddColumnsRequest"
      responses:
        200:
          $ref: "#/components/responses/AlterTableAddColumnsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/backfill_column:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Data
      summary: Trigger an async column backfill job
      operationId: AlterTableBackfillColumns
      description: |
        Trigger an asynchronous backfill job for a computed column on table `id`.
        The column must be a virtual (UDF-backed) column or a computed column
        declared with an expression binding. Returns a job ID for tracking.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AlterTableBackfillColumnsRequest"
      responses:
        202:
          $ref: "#/components/responses/AlterTableBackfillColumnsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/materialized_view/{id}/refresh:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - MaterializedView
        - Data
      summary: Trigger an async materialized view refresh
      operationId: RefreshMaterializedView
      description: |
        Trigger an asynchronous refresh job for materialized view `id`.
        Returns a job ID for tracking.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RefreshMaterializedViewRequest"
      responses:
        202:
          $ref: "#/components/responses/RefreshMaterializedViewResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/materialized_view/{id}/create:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - MaterializedView
        - Data
      summary: Create a materialized view
      operationId: CreateMaterializedView
      description: |
        Create a materialized view at identifier `id`. The view may be
        query-backed, UDTF-backed, or chunker-backed, controlled by the
        `kind` discriminator.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateMaterializedViewRequest"
      responses:
        201:
          $ref: "#/components/responses/CreateMaterializedViewResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  # Table Index APIs

  /v1/table/{id}/create_index:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Index
        - Metadata
      summary: Create an index on a table
      operationId: CreateTableIndex
      description: |
        Create an index on a table field for faster search operations.
        Supports vector indexes (IVF_FLAT, IVF_HNSW_SQ, IVF_PQ, etc.) and scalar indexes (BTREE, BITMAP, FTS, etc.).
        Index creation is handled asynchronously.
        Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress.
      requestBody:
        description: Index creation request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTableIndexRequest"
        required: true
      responses:
        200:
          $ref: "#/components/responses/CreateTableIndexResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/create_scalar_index:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Index
        - Metadata
      summary: Create a scalar index on a table
      operationId: CreateTableScalarIndex
      description: |
        Create a scalar index on a table field for faster filtering operations.
        Supports scalar indexes (BTREE, BITMAP, LABEL_LIST, FTS, etc.).
        This is an alias for CreateTableIndex specifically for scalar indexes.
        Index creation is handled asynchronously.
        Use the `ListTableIndices` and `DescribeTableIndexStats` operations to monitor index creation progress.
      requestBody:
        description: Scalar index creation request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTableIndexRequest"
        required: true
      responses:
        200:
          $ref: "#/components/responses/CreateTableScalarIndexResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/index/list:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Index
        - Metadata
      summary: List indexes on a table
      operationId: ListTableIndices
      description: |
        List all indices created on a table. Returns information about each index
        including name, columns, status, and UUID.
      requestBody:
        description: Index list request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ListTableIndicesRequest"
        required: true
      responses:
        200:
          $ref: "#/components/responses/ListTableIndicesResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/index/{index_name}/stats:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - name: index_name
        in: path
        description: Name of the index to get stats for
        required: true
        schema:
          type: string
    post:
      tags:
        - Table
        - Index
        - Metadata
      summary: Get table index statistics
      operationId: DescribeTableIndexStats
      description: |
        Get statistics for a specific index on a table. Returns information about
        the index type, distance type (for vector indices), and row counts.
      requestBody:
        description: Index stats request
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DescribeTableIndexStatsRequest"
        required: true
      responses:
        200:
          $ref: "#/components/responses/DescribeTableIndexStatsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/index/{index_name}/drop:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/branch"
      - name: index_name
        in: path
        description: Name of the index to drop
        required: true
        schema:
          type: string
    post:
      tags:
        - Table
        - Index
        - Metadata
      summary: Drop a specific index
      operationId: DropTableIndex
      description: |
        Drop the specified index from table `id`.

        REST NAMESPACE ONLY
        REST namespace does not use a request body for this operation.
        The `DropTableIndexRequest` information is passed in the following way:
        - `id`: pass through path parameter of the same name
        - `index_name`: pass through path parameter of the same name
      responses:
        200:
          $ref: "#/components/responses/DropTableIndexResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  # Table Tag APIs

  /v1/table/{id}/tags/list:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/page_token"
      - $ref: "#/components/parameters/limit"
    post:
      tags:
        - Table
        - Tag
        - Metadata
      summary: List all tags for a table
      operationId: ListTableTags
      description: |
        List all tags that have been created for table `id`.
        Returns a map of tag names to their corresponding version numbers and metadata.

        REST NAMESPACE ONLY
        REST namespace does not use a request body for this operation.
        The `ListTableTagsRequest` information is passed in the following way:
        - `id`: pass through path parameter of the same name
        - `page_token`: pass through query parameter of the same name
        - `limit`: pass through query parameter of the same name
      responses:
        200:
          $ref: "#/components/responses/ListTableTagsResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/tags/version:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Tag
        - Metadata
      summary: Get version for a specific tag
      operationId: GetTableTagVersion
      description: |
        Get the version number that a specific tag points to for table `id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetTableTagVersionRequest"
      responses:
        200:
          $ref: "#/components/responses/GetTableTagVersionResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/declare:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Metadata
      summary: Declare a table
      operationId: DeclareTable
      description: |
        Declare a table with the given name without touching storage.
        This is a metadata-only operation that records the table existence and sets up aspects like access control.

        For DirectoryNamespace implementation, this creates a `.lance-reserved` file in the table directory
        to mark the table's existence without creating actual Lance data files.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeclareTableRequest"
      responses:
        200:
          $ref: "#/components/responses/DeclareTableResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/tags/create:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Tag
        - Metadata
      summary: Create a new tag
      operationId: CreateTableTag
      description: |
        Create a new tag for table `id` that points to a specific version.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTableTagRequest"
      responses:
        200:
          $ref: "#/components/responses/CreateTableTagResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/tags/delete:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Tag
        - Metadata
      summary: Delete a tag
      operationId: DeleteTableTag
      description: |
        Delete an existing tag from table `id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeleteTableTagRequest"
      responses:
        200:
          $ref: "#/components/responses/DeleteTableTagResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/tags/update:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Tag
        - Metadata
      summary: Update a tag to point to a different version
      operationId: UpdateTableTag
      description: |
        Update an existing tag for table `id` to point to a different version.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTableTagRequest"
      responses:
        200:
          $ref: "#/components/responses/UpdateTableTagResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  # Branch API

  /v1/table/{id}/branches/list:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
      - $ref: "#/components/parameters/page_token"
      - $ref: "#/components/parameters/limit"
    post:
      tags:
        - Table
        - Branch
        - Metadata
      summary: List all branches for a table
      operationId: ListTableBranches
      description: |
        List all branches that have been created for table `id`.
        Returns a map of branch names to their contents.

        REST NAMESPACE ONLY
        REST namespace does not use a request body for this operation.
        The `ListTableBranchesRequest` information is passed in the following way:
        - `id`: pass through path parameter of the same name
        - `page_token`: pass through query parameter of the same name
        - `limit`: pass through query parameter of the same name
      responses:
        200:
          $ref: "#/components/responses/ListTableBranchesResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/branches/create:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Branch
        - Metadata
      summary: Create a new branch
      operationId: CreateTableBranch
      description: |
        Create a new branch for table `id` starting from a source ref (another
        branch and/or version), defaulting to the latest version of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTableBranchRequest"
      responses:
        200:
          $ref: "#/components/responses/CreateTableBranchResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/table/{id}/branches/delete:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Table
        - Branch
        - Metadata
      summary: Delete a branch
      operationId: DeleteTableBranch
      description: |
        Delete an existing branch from table `id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeleteTableBranchRequest"
      responses:
        200:
          $ref: "#/components/responses/DeleteTableBranchResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  # Transaction API

  /v1/transaction/{id}/describe:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Transaction
        - Metadata
      summary: Describe information about a transaction
      operationId: DescribeTransaction
      description: |
        Return a detailed information for a given transaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DescribeTransactionRequest"
      responses:
        200:
          $ref: "#/components/responses/DescribeTransactionResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

  /v1/transaction/{id}/alter:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/delimiter"
    post:
      tags:
        - Transaction
        - Metadata
      summary: Alter information of a transaction.
      operationId: AlterTransaction
      description: |
        Alter a transaction with a list of actions such as setting status or properties.
        The server should either succeed and apply all actions, or fail and apply no action.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AlterTransactionRequest"
      responses:
        200:
          $ref: "#/components/responses/AlterTransactionResponse"
        400:
          $ref: "#/components/responses/BadRequestErrorResponse"
        401:
          $ref: "#/components/responses/UnauthorizedErrorResponse"
        403:
          $ref: "#/components/responses/ForbiddenErrorResponse"
        404:
          $ref: "#/components/responses/NotFoundErrorResponse"
        409:
          $ref: "#/components/responses/ConflictErrorResponse"
        503:
          $ref: "#/components/responses/ServiceUnavailableErrorResponse"
        5XX:
          $ref: "#/components/responses/ServerErrorResponse"

components:
  parameters:
    id:
      name: id
      description: |
        `string identifier` of an object in a namespace, following the Lance Namespace spec.
        When the value is equal to the delimiter, it represents the root namespace.
        For example, `v1/namespace/$/list` performs a `ListNamespace` on the root namespace.
      in: path
      required: true
      schema:
        type: string
    delimiter:
      name: delimiter
      description: |
        An optional delimiter of the `string identifier`, following the Lance Namespace spec.
        When not specified, the `$` delimiter must be used.
      in: query
      required: false
      schema:
        type: string
    branch:
      name: branch
      description: |
        Optional branch to target. When not specified, the main branch is used.
        Used by branch-scoped operations that cannot carry a `branch` field in
        their request body (Arrow IPC stream and bodyless operations). Operations
        with a JSON request body carry `branch` as a body field instead.
      in: query
      required: false
      schema:
        type: string
    page_token:
      name: page_token
      description: Pagination token from a previous request
      in: query
      required: false
      schema:
        $ref: "#/components/schemas/PageToken"
    limit:
      name: limit
      description: Maximum number of items to return
      in: query
      required: false
      schema:
        $ref: "#/components/schemas/PageLimit"
    with_table_uri:
      name: with_table_uri
      description: Whether to include the table URI in the response
      in: query
      required: false
      schema:
        type: boolean
        default: false
    include_declared:
      name: include_declared
      description: |
        When true (default), includes tables that have been declared in the namespace
        but not yet created on storage, in addition to tables that have
        been created. When false, only tables with storage
        components are returned.
      in: query
      required: false
      schema:
        type: boolean
        default: true
    load_detailed_metadata:
      name: load_detailed_metadata
      description: |
        Whether to load detailed metadata that requires opening the dataset.
        When false (default), only `location` is required in the response.
        When true, the response includes additional metadata such as `version`, `schema`, and `stats`.
      in: query
      required: false
      schema:
        type: boolean
        default: false
    check_declared:
      name: check_declared
      description: |
        Whether to check if the table exists only as a namespace declaration
        without storage data. When false (default), the response should return
        null for `is_only_declared` unless another option such as
        `load_detailed_metadata` requires the check.
      in: query
      required: false
      schema:
        type: boolean
        default: false

  schemas:
    ErrorResponse:
      type: object
      description: Common JSON error response model
      required:
        - code
      properties:
        context:
          $ref: "#/components/schemas/Context"
        error:
          type: string
          description: A brief, human-readable message about the error.
          example: Table 'users' not found in namespace 'production'
        code:
          type: integer
          minimum: 0
          description: |
            Lance Namespace error code identifying the error type.

            Error codes:
              0 - Unsupported: Operation not supported by this backend
              1 - NamespaceNotFound: The specified namespace does not exist
              2 - NamespaceAlreadyExists: A namespace with this name already exists
              3 - NamespaceNotEmpty: Namespace contains tables or child namespaces
              4 - TableNotFound: The specified table does not exist
              5 - TableAlreadyExists: A table with this name already exists
              6 - TableIndexNotFound: The specified table index does not exist
              7 - TableIndexAlreadyExists: A table index with this name already exists
              8 - TableTagNotFound: The specified table tag does not exist
              9 - TableTagAlreadyExists: A table tag with this name already exists
              10 - TransactionNotFound: The specified transaction does not exist
              11 - TableVersionNotFound: The specified table version does not exist
              12 - TableColumnNotFound: The specified table field does not exist
              13 - InvalidInput: Malformed request or invalid parameters
              14 - ConcurrentModification: Optimistic concurrency conflict
              15 - PermissionDenied: User lacks permission for this operation
              16 - Unauthenticated: Authentication credentials are missing or invalid
              17 - ServiceUnavailable: Service is temporarily unavailable
              18 - Internal: Unexpected server/implementation error
              19 - InvalidTableState: Table is in an invalid state for the operation
              20 - TableSchemaValidationError: Table schema validation failed
              21 - Throttling: Request rate limit exceeded
              22 - TableBranchNotFound: The specified table branch does not exist
              23 - TableBranchAlreadyExists: A table branch with this name already exists
          example: 4
        detail:
          type: string
          description: |
            An optional human-readable explanation of the error.
            This can be used to record additional information such as stack trace.
          example: The table may have been dropped or renamed
        instance:
          type: string
          description: |
            A string that identifies the specific occurrence of the error.
            This can be a URI, a request or response ID,
            or anything that the implementation can recognize to trace specific occurrence of the error.
          example: /v1/table/production$users/describe

    Identity:
      type: object
      description: |
        Identity information of a request.
      properties:
        api_key:
          type: string
          description: |
            API key for authentication.

            REST NAMESPACE ONLY
            This is passed via the `x-api-key` header.
        auth_token:
          type: string
          description: |
            Bearer token for authentication.

            REST NAMESPACE ONLY
            This is passed via the `Authorization` header
            with the Bearer scheme (e.g., `Bearer <token>`).

    Context:
      type: object
      description: |
        Arbitrary context as key-value pairs.
        How to use the context is custom to the specific implementation.

        On a request, it carries caller-provided context to the implementation.
        On a response, it carries implementation-provided context back to the caller.

        REST NAMESPACE ONLY
        Context entries are mapped to and from HTTP headers using the `header.` prefix:
        - On a request, any entry whose key starts with `header.` is sent as an HTTP
          request header with the prefix stripped. For example, the entry
          `{"header.Authorization": "Bearer abc"}` is sent as the request header
          `Authorization: Bearer abc`.
        - On a response, every HTTP response header is returned as an entry whose key is the
          header name prefixed with `header.`. For example, the response header
          `x-request-id: abc123` is returned as the entry `{"header.x-request-id": "abc123"}`.
      additionalProperties:
        type: string

    CreateNamespaceRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        mode:
          type: string
          description: |
            There are three modes when trying to create a namespace,
            to differentiate the behavior when a namespace of the same name already exists.
            Case insensitive, supports both PascalCase and snake_case. Valid values are:
              * Create: the operation fails with 409.
              * ExistOk: the operation succeeds and the existing namespace is kept.
              * Overwrite: the existing namespace is dropped and a new empty namespace with this name is created.
        properties:
          type: object
          description: |
            Properties stored on the namespace, if supported by the implementation.
          additionalProperties:
            type: string

    CreateNamespaceResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        properties:
          description: |
            Properties after the namespace is created.

            If the server does not support namespace properties, it should return null for this field.
            If namespace properties are supported, but none are set, it should return an empty object.
          type: object
          additionalProperties:
            type: string

    ListNamespacesRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        page_token:
          $ref: "#/components/schemas/PageToken"
        limit:
          $ref: "#/components/schemas/PageLimit"

    ListNamespacesResponse:
      type: object
      required:
        - namespaces
      properties:
        context:
          $ref: "#/components/schemas/Context"
        namespaces:
          type: array
          uniqueItems: true
          description: |
            The list of names of the child namespaces relative to the parent namespace `id` in the request.
          items:
            type: string
        page_token:
          $ref: "#/components/schemas/PageToken"

    DescribeNamespaceRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string

    DescribeNamespaceResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        properties:
          type: object
          description:
            Properties stored on the namespace, if supported by the server.
            If the server does not support namespace properties, it should return null for this field.
            If namespace properties are supported, but none are set, it should return an empty object.
          additionalProperties:
            type: string
          example: { "owner": "Ralph", "created_at": "1452120468" }
          default: {}
          nullable: true

    DropNamespaceRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        mode:
          type: string
          description: |
            The mode for dropping a namespace, deciding the server behavior when the namespace to drop is not found.
            Case insensitive, supports both PascalCase and snake_case. Valid values are:
            - Fail (default): the server must return 400 indicating the namespace to drop does not exist.
            - Skip: the server must return 204 indicating the drop operation has succeeded.
        behavior:
          type: string
          description: |
            The behavior for dropping a namespace.
            Case insensitive, supports both PascalCase and snake_case. Valid values are:
            - Restrict (default): the namespace should not contain any table or child namespace when drop is initiated.
                If tables are found, the server should return error and not drop the namespace.
            - Cascade: all tables and child namespaces in the namespace are dropped before the namespace is dropped.

    DropNamespaceResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        properties:
          type: object
          description: |
            If the implementation does not support namespace properties, it should return null for this field. Otherwise it should return the properties.
          additionalProperties:
            type: string
        transaction_id:
          description: |
            If present, indicating the operation is long running and should be tracked using DescribeTransaction
          type: array
          items:
            type: string

    NamespaceExistsRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string

    NamespaceExistsResponse:
      type: object
      description: |
        Response for a namespace existence check.

        The REST namespace does not transmit this object directly (see the NamespaceExists
        operation for how the status-code response maps to it). It is the standard data model
        for the LanceNamespace interfaces (e.g. Java, Python).
      properties:
        context:
          $ref: "#/components/schemas/Context"

    PageToken:
      description: |
        An opaque token that allows pagination for list operations (e.g. ListNamespaces).

        For an initial request of a list operation,
        if the implementation cannot return all items in one response,
        or if there are more items than the page limit specified in the request,
        the implementation must return a page token in the response,
        indicating there are more results available.

        After the initial request,
        the value of the page token from each response must be used
        as the page token value for the next request.

        Caller must interpret either `null`,
        missing value or empty string value of the page token from
        the implementation's response as the end of the listing results.
      type: string
      nullable: true

    PageLimit:
      description: |
        An inclusive upper bound of the
        number of results that a caller will receive.
      type: integer
      nullable: true

    RegisterTableRequest:
      type: object
      required:
        - location
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        location:
          type: string
        mode:
          type: string
          description: |
            There are two modes when trying to register a table,
            to differentiate the behavior when a table of the same name already exists.
            Case insensitive, supports both PascalCase and snake_case. Valid values are:
              * Create (default): the operation fails with 409.
              * Overwrite: the existing table registration is replaced with the new registration.
        properties:
          type: object
          description: |
            Properties stored on the table, if supported by the implementation.
          additionalProperties:
            type: string

    RegisterTableResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        location:
          type: string
        properties:
          type: object
          description: |
            If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties.
          additionalProperties:
            type: string

    ListTablesRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        page_token:
          $ref: "#/components/schemas/PageToken"
        limit:
          $ref: "#/components/schemas/PageLimit"
        include_declared:
          type: boolean
          default: true
          description: |
            When true (default), includes tables that have been declared in the namespace
            but not yet created on storage, in addition to tables that have
            been created. When false, only tables with storage
            components are returned.

    ListTablesResponse:
      type: object
      required:
        - tables
      properties:
        context:
          $ref: "#/components/schemas/Context"
        tables:
          type: array
          uniqueItems: true
          description: |
            The list of names of all the tables under the connected namespace implementation.
            This should recursively list all the tables in all child namespaces.
            Each string in the list is the full identifier in string form.
          items:
            type: string
        page_token:
          $ref: "#/components/schemas/PageToken"

    DescribeTableRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        version:
          description: |
            Version of the table to describe.
            If not specified, server should resolve it to the latest version.
          type: integer
          format: int64
          minimum: 0
        tag:
          description: |
            Tag name to describe the table at.
            If specified, the server should resolve the tag to a version number and describe that version.
            Cannot be used together with `version` or `branch`.
          type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        with_table_uri:
          description: |
            Whether to include the table URI in the response.
            Default is false.
          type: boolean
          default: false
        load_detailed_metadata:
          description: |
            Whether to load detailed metadata that requires opening the dataset.
            When true, the response must include all detailed metadata such as `version`, `schema`, and `stats`
            which require reading the dataset.
            When not set, the implementation can decide whether to return detailed metadata
            and which parts of detailed metadata to return.
          type: boolean
        check_declared:
          description: |
            Whether to check if the table exists only as a namespace declaration
            without storage data. Default is false.
            When true, the response should populate `is_only_declared`.
            When false, the implementation should return null for `is_only_declared`
            unless another option such as `load_detailed_metadata` requires
            checking declared-only table state.
          type: boolean
          default: false
        vend_credentials:
          description: |
            Whether to include vended credentials in the response `storage_options`.
            When true, the implementation should provide vended credentials for accessing storage.
            When not set, the implementation can decide whether to return vended credentials.
          type: boolean

    DescribeTableResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        table:
          type: string
          description: |
            Table name.
            Only populated when `load_detailed_metadata` is true.
        namespace:
          type: array
          items:
            type: string
          description: |
            The namespace identifier as a list of parts.
            Only populated when `load_detailed_metadata` is true.
        version:
          type: integer
          format: int64
          minimum: 0
          description: |
            Table version number.
            Only populated when `load_detailed_metadata` is true.
        location:
          type: string
          description: |
            Table storage location (e.g., S3/GCS path).
        table_uri:
          type: string
          description: |
            Table URI. Unlike location, this field must be a complete and valid URI.
            Only returned when `with_table_uri` is true.
        schema:
          $ref: "#/components/schemas/JsonArrowSchema"
          description: |
            Table schema in JSON Arrow format.
            Only populated when `load_detailed_metadata` is true.
        storage_options:
          type: object
          description: |
            Configuration options to be used to access storage. The available
            options depend on the type of storage in use. These will be
            passed directly to Lance to initialize storage access.
            When `vend_credentials` is true, this field may include vended credentials.
            If the vended credentials are temporary, the `expires_at_millis` key should be
            included to indicate the millisecond timestamp when the credentials expire.
          additionalProperties:
            type: string
        stats:
          $ref: "#/components/schemas/TableBasicStats"
          nullable: true
          description: |
            Table statistics.
            Only populated when `load_detailed_metadata` is true.
        metadata:
          type: object
          description: |
            Optional table metadata as key-value pairs. This records the information of the table
            and requires loading the table.
            It is only populated when `load_detailed_metadata` is true.
          additionalProperties:
            type: string
        properties:
          type: object
          description:
            Properties stored on the table, if supported by the server. This records the
            information managed by the namespace.
            If the server does not support table properties, it should return null for this field.
            If table properties are supported, but none are set, it should return an empty object.
          additionalProperties:
            type: string
          example: { "owner": "Ralph", "created_at": "1452120468" }
          default: {}
          nullable: true
        managed_versioning:
          type: boolean
          description: |
            When true, the caller should use namespace table version operations
            (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions)
            to manage table versions instead of relying on Lance's native version management.
        is_only_declared:
          type: boolean
          nullable: true
          description: |
            When true, indicates that the table has been declared in the namespace
            but not yet created on storage. This means the table exists in the
            namespace but has no data files on the underlying storage.
            When false, the table has storage components (data and metadata files).
            When null, the implementation did not check whether the table is only
            declared. Clients should treat an omitted value as null. Implementations
            should populate this field when `check_declared` is true or another
            option such as `load_detailed_metadata` requires checking declared-only
            table state. Operations like describe_table with load_detailed_metadata=true
            may fail for declared-only tables.

    TableBasicStats:
      type: object
      required:
        - num_deleted_rows
        - num_fragments
      properties:
        num_deleted_rows:
          type: integer
          minimum: 0
          description: Number of deleted rows in the table
        num_fragments:
          type: integer
          minimum: 0
          description: Number of fragments in the table

    CountTableRowsRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        version:
          description: |
            Version of the table to describe.
            If not specified, server should resolve it to the latest version.
          type: integer
          format: int64
          minimum: 0
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        predicate:
          description: |
            Optional SQL predicate to filter rows for counting. Field
            references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled.
          type: string

    CountTableRowsResponse:
      type: object
      description: |
        Response containing the count of rows.

        The REST namespace does not transmit this object directly (see the CountTableRows
        operation for how the bare-number response maps to it). It is the standard data model
        for the LanceNamespace interfaces (e.g. Java, Python).
      properties:
        context:
          $ref: "#/components/schemas/Context"
        count:
          type: integer
          format: int64
          minimum: 0
          description: The count of rows.

    InsertIntoTableRequest:
      type: object
      description: |
        Request for inserting records into a table, excluding the Arrow IPC stream.
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        mode:
          type: string
          description: |
            How the insert should behave. Case insensitive, supports both PascalCase and snake_case. Valid values are:
            - Append (default): insert data to the existing table
            - Overwrite: remove all data in the table and then insert data to it
          default: append

    InsertIntoTableResponse:
      type: object
      description: Response from inserting records into a table
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        num_inserted_rows:
          type: integer
          format: int64
          description: Number of rows inserted
          minimum: 0
        version:
          type: integer
          format: int64
          description: The commit version associated with the operation
          minimum: 0

    MergeInsertIntoTableRequest:
      type: object
      description: |
        Request for merging or inserting records into a table, excluding the Arrow IPC stream.
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        "on":
          description: Lance field paths to use for matching rows. Multiple fields form a composite match key; a row matches only when every listed field is equal. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
          type: array
          minItems: 1
          items:
            type: string
            minLength: 1
        when_matched_update_all:
          description: Update all columns when rows match
          type: boolean
          default: false
        when_matched_update_all_filt:
          description: "The row is updated (similar to UpdateAll) only for rows where the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled."
          type: string
        when_not_matched_insert_all:
          description: Insert all columns when rows don't match
          type: boolean
          default: false
        when_not_matched_by_source_delete:
          description: Delete all rows from target table that don't match a row in the source table
          type: boolean
          default: false
        when_not_matched_by_source_delete_filt:
          description: "Delete rows from the target table if there is no match AND the SQL expression evaluates to true. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled."
          type: string
        timeout:
          description: Timeout for the operation (e.g., "30s", "5m")
          type: string
        use_index:
          description: Whether to use index for matching rows
          type: boolean
          default: false

    MergeInsertIntoTableResponse:
      type: object
      description: Response from merge insert operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        num_updated_rows:
          type: integer
          format: int64
          description: Number of rows updated
          minimum: 0
        num_inserted_rows:
          type: integer
          format: int64
          description: Number of rows inserted
          minimum: 0
        num_deleted_rows:
          type: integer
          format: int64
          description: Number of rows deleted (typically 0 for merge insert)
          minimum: 0
        version:
          type: integer
          format: int64
          description: The commit version associated with the operation
          minimum: 0

    UpdateTableRequest:
      type: object
      description: |
        Each update consists of a field path and an SQL expression that will be
        evaluated against the current row's value. Optionally, a predicate can be
        provided to filter which rows to update.
      required:
        - updates
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        predicate:
          type: string
          nullable: true
          description: "Optional SQL predicate to filter rows for update. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled."
        updates:
          type: array
          items:
            type: array
            minItems: 2
            maxItems: 2
            items:
              type: string
          description: "List of field updates as [field_path, expression] pairs. Field paths and expression references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled."
        properties:
          type: object
          description: |
            Properties stored on the table, if supported by the implementation.
          additionalProperties:
            type: string

    UpdateTableResponse:
      type: object
      required:
        - updated_rows
        - version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        updated_rows:
          type: integer
          format: int64
          description: Number of rows updated
          minimum: 0
        version:
          type: integer
          format: int64
          description: The commit version associated with the operation
          minimum: 0
        properties:
          type: object
          description: |
            If the implementation does not support table properties, it should return null for this field. Otherwise, it should return the properties.
          additionalProperties:
            type: string

    DeleteFromTableRequest:
      type: object
      description: |
        Delete data from table based on a SQL predicate.
        Returns the number of rows that were deleted.
      required:
        - predicate
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The namespace identifier
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        predicate:
          type: string
          description: "SQL predicate to filter rows for deletion. Field references must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled."

    DeleteFromTableResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        version:
          type: integer
          format: int64
          description: The commit version associated with the operation
          minimum: 0

    QueryTableRequest:
      type: object
      required:
        - vector
        - k
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        bypass_vector_index:
          type: boolean
          description: Whether to bypass vector index
        columns:
          type: object
          nullable: true
          description: |
            Optional field paths to return. Provide either column_names or
            column_aliases, not both.
          properties:
            column_names:
              type: array
              items:
                type: string
                minLength: 1
              description: List of Lance field paths to return. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments.
            column_aliases:
              type: object
              additionalProperties:
                type: string
                minLength: 1
              description: Object mapping output aliases to source Lance field paths. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments.
        distance_type:
          type: string
          description: Distance metric to use
        ef:
          type: integer
          minimum: 0
          description: Search effort parameter for HNSW index
        fast_search:
          type: boolean
          description: Whether to use fast search
        filter:
          type: string
          description: |
            Optional SQL filter expression. Field references in the expression must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled.
        full_text_query:
          type: object
          nullable: true
          description: Optional full-text search query. Provide either string_query or structured_query, not both.
          properties:
            string_query:
              $ref: "#/components/schemas/StringFtsQuery"
            structured_query:
              $ref: "#/components/schemas/StructuredFtsQuery"
        k:
          type: integer
          minimum: 0
          description: Number of results to return
        lower_bound:
          type: number
          format: float
          description: Lower bound for search
        maximum_nprobes:
          type: integer
          minimum: 1
          description: Maximum number of IVF partitions to search. When omitted, all partitions may be searched if needed.
        minimum_nprobes:
          type: integer
          minimum: 1
          description: Minimum number of IVF partitions to search before adaptive expansion.
        nprobes:
          type: integer
          minimum: 0
          description: Legacy exact number of IVF partitions to search. Ignored when minimum_nprobes or maximum_nprobes is provided.
        offset:
          type: integer
          minimum: 0
          description: Number of results to skip
        prefilter:
          type: boolean
          description: Whether to apply filtering before vector search
        refine_factor:
          type: integer
          format: int32
          minimum: 0
          description: Refine factor for search
        upper_bound:
          type: number
          format: float
          description: Upper bound for search
        vector:
          type: object
          nullable: true
          description: Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both.
          properties:
            single_vector:
              type: array
              items:
                type: number
                format: float
              description: Single query vector
            multi_vector:
              type: array
              items:
                type: array
                items:
                  type: number
                  format: float
              description: Multiple query vectors for batch search
        vector_column:
          type: string
          minLength: 1
          description: Lance field path of the vector field to search. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
        version:
          type: integer
          format: int64
          minimum: 0
          description: Table version to query
        with_row_id:
          type: boolean
          description: If true, return the row id as a column called `_rowid`

    QueryTableResponse:
      type: object
      description: |
        Query results.

        The REST namespace does not transmit this object directly (see the QueryTable
        operation for how the Arrow IPC binary response maps to it). It is the standard data
        model for the LanceNamespace interfaces (e.g. Java, Python).
      properties:
        context:
          $ref: "#/components/schemas/Context"
        data:
          type: string
          format: binary
          description: Query results as Arrow IPC file binary data.

    CreateTableIndexRequest:
      type: object
      required:
        - column
        - index_type
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        column:
          type: string
          minLength: 1
          description: Lance field path to create the index on. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
        index_type:
          type: string
          description: Type of index to create (e.g., BTREE, BITMAP, LABEL_LIST, IVF_FLAT, IVF_PQ, IVF_HNSW_SQ, FTS)
        name:
          type: string
          nullable: true
          description: Optional name for the index. If not provided, a name will be auto-generated.
        distance_type:
          type: string
          description: Distance metric type for vector indexes (e.g., l2, cosine, dot)
        num_partitions:
          type: integer
          nullable: true
          minimum: 1
          description: Optional vector index parameter for the number of IVF partitions. Applies to all IVF index types.
        num_sub_vectors:
          type: integer
          nullable: true
          minimum: 1
          description: Optional vector index parameter for the number of PQ sub-vectors. Applies to IVF_PQ only.
        num_bits:
          type: integer
          nullable: true
          minimum: 1
          description: Optional vector index parameter for the number of bits used by the quantizer.
        sample_rate:
          type: integer
          nullable: true
          minimum: 1
          description: Optional vector index parameter for the per-partition sample rate used during IVF training.
        max_iterations:
          type: integer
          nullable: true
          minimum: 1
          description: Optional vector index parameter for the maximum number of IVF k-means training iterations.
        target_partition_size:
          type: integer
          nullable: true
          minimum: 1
          description: Optional vector index parameter for the target partition size. Alternative to num_partitions.
        m:
          type: integer
          nullable: true
          minimum: 1
          description: Optional vector index parameter for the number of edges per node in the HNSW graph. Applies to HNSW index types.
        ef_construction:
          type: integer
          nullable: true
          minimum: 1
          description: Optional vector index parameter for the number of candidates evaluated during HNSW graph construction. Applies to HNSW index types.
        with_position:
          type: boolean
          nullable: true
          description: Optional FTS parameter for position tracking
        base_tokenizer:
          type: string
          nullable: true
          description: Optional FTS parameter for base tokenizer
        language:
          type: string
          nullable: true
          description: Optional FTS parameter for language
        max_token_length:
          type: integer
          nullable: true
          minimum: 0
          description: Optional FTS parameter for maximum token length
        lower_case:
          type: boolean
          nullable: true
          description: Optional FTS parameter for lowercase conversion
        stem:
          type: boolean
          nullable: true
          description: Optional FTS parameter for stemming
        remove_stop_words:
          type: boolean
          nullable: true
          description: Optional FTS parameter for stop word removal
        ascii_folding:
          type: boolean
          nullable: true
          description: Optional FTS parameter for ASCII folding

    CreateTableIndexResponse:
      type: object
      description: Response for create index operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    CreateTableScalarIndexResponse:
      type: object
      description: Response for create scalar index operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    ListTableIndicesRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The namespace identifier
        version:
          type: integer
          format: int64
          minimum: 0
          nullable: true
          description: Optional table version to list indexes from
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        page_token:
          $ref: "#/components/schemas/PageToken"
        limit:
          $ref: "#/components/schemas/PageLimit"

    ListTableIndicesResponse:
      type: object
      required:
        - indexes
      properties:
        context:
          $ref: "#/components/schemas/Context"
        indexes:
          type: array
          items:
            $ref: "#/components/schemas/IndexContent"
          description: List of indexes on the table
        page_token:
          $ref: "#/components/schemas/PageToken"

    IndexContent:
      type: object
      required:
        - index_name
        - index_uuid
        - columns
        - status
      properties:
        index_name:
          type: string
          description: Name of the index
        index_uuid:
          type: string
          description: Unique identifier for the index
        columns:
          type: array
          items:
            type: string
            minLength: 1
          description: Canonical Lance field paths covered by this index. Nested fields use dot-separated segments; segments containing literal dots are backtick-quoted, and backticks inside quoted segments are doubled.
        status:
          type: string
          description: Current status of the index
        index_type:
          type: string
          description: >-
            Friendly index type, e.g. IVF_PQ, BTREE. Unknown if no plugin
            recognizes the index.
        type_url:
          type: string
          description: Protobuf type URL, a precise type identifier for the index.
        num_indexed_rows:
          type: integer
          format: int64
          minimum: 0
          description: >-
            Number of live rows covered by the index. This does not count
            rows that are in the index but have since been deleted.
        num_unindexed_rows:
          type: integer
          format: int64
          minimum: 0
          description: >-
            Number of rows that are not indexed.
        size_bytes:
          type: integer
          format: int64
          minimum: 0
          nullable: true
          description: >-
            Total index size in bytes across all segments. Null for indices
            predating file-size tracking.
        num_segments:
          type: integer
          format: int32
          minimum: 0
          description: Number of index deltas/segments.
        created_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Creation time for indexes. Null for legacy indices.
        index_version:
          type: integer
          format: int32
          minimum: 0
          description: On-disk index format version.
        index_details:
          type: string
          nullable: true
          description: >-
            Opaque, type-specific JSON with additional index details. For vector
            indices this carries metric/distance type, partitioning, and
            HNSW/PQ/SQ/RQ parameters.

    DescribeTableIndexStatsRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        version:
          type: integer
          format: int64
          minimum: 0
          nullable: true
          description: Optional table version to get stats for
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        index_name:
          type: string
          description: Name of the index

    DescribeTableIndexStatsResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        distance_type:
          type: string
          nullable: true
          description: Distance type for vector indexes
        index_type:
          type: string
          nullable: true
          description: Type of the index
        num_indexed_rows:
          type: integer
          format: int64
          minimum: 0
          nullable: true
          description: Number of indexed rows
        num_unindexed_rows:
          type: integer
          format: int64
          minimum: 0
          nullable: true
          description: Number of unindexed rows
        num_indices:
          type: integer
          format: int32
          minimum: 0
          nullable: true
          description: Number of indices

    JsonArrowSchema:
      type: object
      description: |
        JSON representation of a Apache Arrow schema.
      required:
        - fields
      properties:
        fields:
          type: array
          items:
            $ref: "#/components/schemas/JsonArrowField"
        metadata:
          type: object
          additionalProperties:
            type: string
          propertyNames:
            type: string

    JsonArrowField:
      type: object
      description: |
        JSON representation of an Apache Arrow field.
      required:
        - name
        - type
        - nullable
      properties:
        metadata:
          type: object
          additionalProperties:
            type: string
          propertyNames:
            type: string
        name:
          type: string
        nullable:
          type: boolean
        type:
          $ref: "#/components/schemas/JsonArrowDataType"
    JsonArrowDataType:
      type: object
      description: JSON representation of an Apache Arrow DataType
      required:
        - type
      properties:
        fields:
          type: array
          items:
            $ref: "#/components/schemas/JsonArrowField"
          description: Fields for complex types like Struct, Union, etc.
        length:
          type: integer
          format: int64
          description: Length for fixed-size types
          minimum: 0
        type:
          type: string
          description: The data type name

    Binary:
      type: string
      format: binary

    CreateTableRequest:
      type: object
      description: |
        Request for creating a table, excluding the Arrow IPC stream.
        The table location and any credential vending behavior are determined by the implementation
        and returned in the response, rather than specified in this request.
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        mode:
          type: string
          description: |
            There are three modes when trying to create a table,
            to differentiate the behavior when a table of the same name already exists.
            Case insensitive, supports both PascalCase and snake_case. Valid values are:
              * Create: the operation fails with 409.
              * ExistOk: the operation succeeds and the existing table is kept.
              * Overwrite: the existing table is dropped and a new table with this name is created.
        properties:
          type: object
          description: |
            Business logic properties stored and managed by the namespace implementation outside
            Lance context, if supported by the implementation.
          additionalProperties:
            type: string
        storage_options:
          type: object
          description: |
            Storage options that configure overrides for writing table data and metadata during
            table creation. These are passed to Lance for the write path.
          additionalProperties:
            type: string

    CreateTableResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        location:
          type: string
        version:
          type: integer
          format: int64
          minimum: 0
        storage_options:
          type: object
          description: |
            Configuration options to be used to access storage. The available
            options depend on the type of storage in use. These will be
            passed directly to Lance to initialize storage access.
          additionalProperties:
            type: string
        properties:
          type: object
          description: |
            Business logic properties stored and managed by the namespace implementation outside
            Lance context. If the implementation does not support table properties, it should
            return null for this field.
          additionalProperties:
            type: string
          example: { "owner": "Ralph", "created_at": "1452120468" }
          default: {}
          nullable: true

    DeclareTableRequest:
      type: object
      description: |
        Request for declaring a table.
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        location:
          type: string
          description: |
            Optional storage location for the table.
            If not provided, the namespace implementation should determine the table location.
        vend_credentials:
          description: |
            Whether to include vended credentials in the response `storage_options`.
            When true, the implementation should provide vended credentials for accessing storage.
            When not set, the implementation can decide whether to return vended credentials.
          type: boolean
        properties:
          type: object
          description: |
            Business logic properties stored and managed by the namespace implementation outside
            Lance context, if supported by the implementation.
          additionalProperties:
            type: string

    DeclareTableResponse:
      type: object
      description: |
        Response for declaring a table.
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        location:
          type: string
        storage_options:
          type: object
          description: |
            Configuration options to be used to access storage. The available
            options depend on the type of storage in use. These will be
            passed directly to Lance to initialize storage access.
          additionalProperties:
            type: string
        properties:
          type: object
          description: |
            If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties.
          additionalProperties:
            type: string
          example: { "owner": "Ralph", "created_at": "1452120468" }
          default: {}
          nullable: true
        managed_versioning:
          type: boolean
          description: |
            When true, the caller should use namespace table version operations
            (CreateTableVersion, BatchCreateTableVersions, DescribeTableVersion, ListTableVersions, BatchDeleteTableVersions)
            to manage table versions instead of relying on Lance's native version management.

    TableExistsRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        version:
          description: |
            Version of the table to check existence.
            If not specified, server should resolve it to the latest version.
          type: integer
          format: int64
          minimum: 0

    TableExistsResponse:
      type: object
      description: |
        Response for a table existence check.

        The REST namespace does not transmit this object directly (see the TableExists
        operation for how the status-code response maps to it). It is the standard data model
        for the LanceNamespace interfaces (e.g. Java, Python).
      properties:
        context:
          $ref: "#/components/schemas/Context"

    TransactionStatus:
      type: string
      description: |
        The status of a transaction.
        Case insensitive, supports both PascalCase and snake_case. Valid values are:
        - Queued: the transaction is queued and not yet started
        - Running: the transaction is currently running
        - Succeeded: the transaction has completed successfully
        - Failed: the transaction has failed
        - Canceled: the transaction was canceled

    DescribeTransactionRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string

    DescribeTransactionResponse:
      type: object
      required:
        - status
      properties:
        context:
          $ref: "#/components/schemas/Context"
        status:
          $ref: "#/components/schemas/TransactionStatus"
        properties:
          type: object
          additionalProperties:
            type: string

    AlterTransactionSetStatus:
      type: object
      properties:
        status:
          $ref: "#/components/schemas/TransactionStatus"

    AlterTransactionSetProperty:
      type: object
      properties:
        key:
          type: string
        value:
          type: string
        mode:
          $ref: "#/components/schemas/SetPropertyMode"

    SetPropertyMode:
      type: string
      description: |
        The behavior if the property key already exists.
        Case insensitive, supports both PascalCase and snake_case. Valid values are:
        - Overwrite (default): overwrite the existing value with the provided value
        - Fail: fail the entire operation
        - Skip: keep the existing value and skip setting the provided value

    AlterTransactionUnsetProperty:
      type: object
      properties:
        key:
          type: string
        mode:
          $ref: "#/components/schemas/UnsetPropertyMode"

    UnsetPropertyMode:
      type: string
      description: |
        The behavior if the property key to unset does not exist.
        Case insensitive, supports both PascalCase and snake_case. Valid values are:
        - Skip (default): skip the property to unset
        - Fail: fail the entire operation

    AlterTransactionAction:
      type: object
      description: |
        A single action that could be performed to alter a transaction.
        This action holds the model definition for all types of specific actions models,
        this is to minimize difference and compatibility issue across codegen in different languages.
        When used, only one of the actions should be non-null for each action.
        If you would like to perform multiple actions, set a list of actions in the AlterTransactionRequest.
      properties:
        setStatusAction:
          $ref: "#/components/schemas/AlterTransactionSetStatus"
        setPropertyAction:
          $ref: "#/components/schemas/AlterTransactionSetProperty"
        unsetPropertyAction:
          $ref: "#/components/schemas/AlterTransactionUnsetProperty"

    AlterTransactionRequest:
      type: object
      description: |
        Alter a transaction with a list of actions.
        The server should either succeed and apply all actions, or fail and apply no action.
      required:
        - actions
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        actions:
          type: array
          minItems: 1
          items:
            $ref: "#/components/schemas/AlterTransactionAction"

    AlterTransactionResponse:
      type: object
      required:
        - status
      properties:
        context:
          $ref: "#/components/schemas/Context"
        status:
          $ref: "#/components/schemas/TransactionStatus"
        properties:
          type: object
          additionalProperties:
            type: string

    DropTableRequest:
      type: object
      description: |
        If the table and its data can be immediately deleted, return information of the deleted table.
        Otherwise, return a transaction ID that client can use to track deletion progress.
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string

    DropTableResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        id:
          type: array
          items:
            type: string
        location:
          type: string
        properties:
          type: object
          description: |
            If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties.
          additionalProperties:
            type: string
          example: { "owner": "Ralph", "created_at": "1452120468" }
          default: {}
          nullable: true

    DeregisterTableRequest:
      type: object
      description: |
        The table content remains available in the storage.
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string

    DeregisterTableResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        id:
          type: array
          items:
            type: string
        location:
          type: string
        properties:
          type: object
          description: |
            If the implementation does not support table properties, it should return null for this field. Otherwise it should return the properties.
          additionalProperties:
            type: string
          example: { "owner": "Ralph", "created_at": "1452120468" }
          default: {}
          nullable: true

    StringFtsQuery:
      type: object
      required:
        - query
      properties:
        columns:
          type: array
          items:
            type: string
            minLength: 1
          description: Lance field paths to search. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Omit to search all indexed FTS fields.
        query:
          type: string

    StructuredFtsQuery:
      type: object
      required:
        - query
      properties:
        query:
          $ref: "#/components/schemas/FtsQuery"

    FtsQuery:
      type: object
      description: |
        Full-text search query. Exactly one query type field must be provided.
        This structure follows the same pattern as AlterTransactionAction to minimize
        differences and compatibility issues across codegen in different languages.
      properties:
        match:
          $ref: "#/components/schemas/MatchQuery"
        phrase:
          $ref: "#/components/schemas/PhraseQuery"
        boost:
          $ref: "#/components/schemas/BoostQuery"
        multi_match:
          $ref: "#/components/schemas/MultiMatchQuery"
        boolean:
          $ref: "#/components/schemas/BooleanQuery"

    MatchQuery:
      type: object
      required:
        - terms
      properties:
        boost:
          type: number
          format: float
        column:
          type: string
          minLength: 1
          description: Lance field path to match. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Omit to use the query default fields.
        fuzziness:
          type: integer
          format: int32
          minimum: 0
        max_expansions:
          type: integer
          description: |-
            The maximum number of terms to expand for fuzzy matching.
            Default to 50.
          minimum: 0
        operator:
          $ref: "#/components/schemas/Operator"
          description: |-
            The operator to use for combining terms.
            This can be either `And` or `Or`, it's 'Or' by default.
            - `And`: All terms must match.
            - `Or`: At least one term must match.
        prefix_length:
          type: integer
          format: int32
          description: |-
            The number of beginning characters being unchanged for fuzzy matching.
            Default to 0.
          minimum: 0
        terms:
          type: string

    PhraseQuery:
      type: object
      required:
        - terms
      properties:
        column:
          type: string
          minLength: 1
          description: Lance field path to match. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Omit to use the query default fields.
        slop:
          type: integer
          format: int32
          minimum: 0
        terms:
          type: string

    BoostQuery:
      type: object
      description: Boost query that scores documents matching positive query higher and negative query lower
      required:
        - positive
        - negative
      properties:
        positive:
          $ref: "#/components/schemas/FtsQuery"
        negative:
          $ref: "#/components/schemas/FtsQuery"
        negative_boost:
          type: number
          format: float
          description: "Boost factor for negative query (default: 0.5)"
          default: 0.5

    MultiMatchQuery:
      type: object
      required:
        - match_queries
      properties:
        match_queries:
          type: array
          items:
            $ref: "#/components/schemas/MatchQuery"

    BooleanQuery:
      type: object
      description: Boolean query with must, should, and must_not clauses
      required:
        - should
        - must
        - must_not
      properties:
        must:
          type: array
          items:
            $ref: "#/components/schemas/FtsQuery"
          description: Queries that must match (AND)
        must_not:
          type: array
          items:
            $ref: "#/components/schemas/FtsQuery"
          description: Queries that must not match (NOT)
        should:
          type: array
          items:
            $ref: "#/components/schemas/FtsQuery"
          description: Queries that should match (OR)

    Operator:
      type: string
      description: |
        The operator to use for combining terms.
        Case insensitive, supports both PascalCase and snake_case. Valid values are:
        - And: All terms must match.
        - Or: At least one term must match.

    GetTableTagVersionRequest:
      type: object
      required:
        - tag
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        tag:
          type: string
          description: Name of the tag to get version for

    GetTableTagVersionResponse:
      type: object
      required:
        - version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        version:
          type: integer
          format: int64
          minimum: 0
          description: version number that the tag points to
        branch:
          type: string
          description: |
            Branch the tag's version lives on.
            Absent when the tag points to the main branch.

    CreateTableTagRequest:
      type: object
      required:
        - tag
        - version
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        tag:
          type: string
          description: Name of the tag to create
        version:
          type: integer
          format: int64
          minimum: 0
          description: Version number for the tag to point to
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.

    CreateTableTagResponse:
      type: object
      description: Response for create tag operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    DeleteTableTagRequest:
      type: object
      required:
        - tag
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        tag:
          type: string
          description: Name of the tag to delete

    DeleteTableTagResponse:
      type: object
      description: Response for delete tag operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    UpdateTableTagRequest:
      type: object
      required:
        - tag
        - version
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        tag:
          type: string
          description: Name of the tag to update
        version:
          type: integer
          format: int64
          minimum: 0
          description: New version number for the tag to point to
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.

    UpdateTableTagResponse:
      type: object
      description: Response for update tag operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    ListTableTagsRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The table identifier
        page_token:
          $ref: "#/components/schemas/PageToken"
        limit:
          $ref: "#/components/schemas/PageLimit"

    ListTableTagsResponse:
      type: object
      description: Response containing table tags
      required:
        - tags
      properties:
        context:
          $ref: "#/components/schemas/Context"
        tags:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/TagContents"
          description: Map of tag names to their contents
        page_token:
          $ref: "#/components/schemas/PageToken"

    TagContents:
      type: object
      required:
        - version
        - manifestSize
      properties:
        branch:
          type: string
          description: Branch name that the tag was created on (if any)
        version:
          type: integer
          format: int64
          minimum: 0
          description: Version number that the tag points to
        manifestSize:
          type: integer
          format: int64
          minimum: 0
          description: Size of the manifest file in bytes

    BranchContents:
      type: object
      required:
        - parentVersion
        - createAt
        - manifestSize
      properties:
        parentBranch:
          type: string
          description: |
            Name of the branch this branch was created from.
            Absent when the branch was created from the main branch.
        parentVersion:
          type: integer
          format: int64
          minimum: 0
          description: Version of the parent (branch or main) this branch was created from
        createAt:
          type: integer
          format: int64
          minimum: 0
          description: Unix timestamp (in seconds) when the branch was created
        manifestSize:
          type: integer
          format: int64
          minimum: 0
          description: Size of the branch's manifest file in bytes
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Key-value metadata associated with the branch

    CreateTableBranchRequest:
      type: object
      required:
        - name
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        name:
          type: string
          description: Name of the branch to create
        from_branch:
          type: string
          description: |
            Source branch to create the new branch from.
            When omitted, the new branch is created from the main branch.
        from_version:
          type: integer
          format: int64
          minimum: 0
          description: |
            Version of the source (branch or main) to create from.
            When omitted, the latest version of the source is used.

    CreateTableBranchResponse:
      type: object
      description: Response for create branch operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    DeleteTableBranchRequest:
      type: object
      required:
        - name
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        name:
          type: string
          description: Name of the branch to delete

    DeleteTableBranchResponse:
      type: object
      description: Response for delete branch operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    ListTableBranchesRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The table identifier
        page_token:
          $ref: "#/components/schemas/PageToken"
        limit:
          $ref: "#/components/schemas/PageLimit"

    ListTableBranchesResponse:
      type: object
      description: Response containing table branches
      required:
        - branches
      properties:
        context:
          $ref: "#/components/schemas/Context"
        branches:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/BranchContents"
          description: Map of branch names to their contents
        page_token:
          $ref: "#/components/schemas/PageToken"

    RestoreTableRequest:
      type: object
      required:
        - version
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        version:
          type: integer
          format: int64
          minimum: 0
          description: Version to restore to
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.

    RestoreTableResponse:
      type: object
      description: Response for restore table operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    RenameTableRequest:
      type: object
      required:
        - new_table_name
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The table identifier
        new_table_name:
          type: string
          description: New name for the table
        new_namespace_id:
          type: array
          items:
            type: string
          description: New namespace identifier to move the table to (optional, if not specified the table stays in the same namespace)

    RenameTableResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    UpdateTableSchemaMetadataRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The table identifier
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Schema metadata key-value pairs to set

    UpdateTableSchemaMetadataResponse:
      type: object
      properties:
        context:
          $ref: "#/components/schemas/Context"
        metadata:
          type: object
          additionalProperties:
            type: string
          description: The updated schema metadata
        transaction_id:
          type: string
          description: Optional transaction identifier

    ListTableVersionsRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        page_token:
          $ref: "#/components/schemas/PageToken"
        limit:
          $ref: "#/components/schemas/PageLimit"
        descending:
          type: boolean
          description: |
            When true, versions are guaranteed to be returned in descending order (latest to oldest).
            When false or not specified, the ordering is implementation-defined.

    ListTableVersionsResponse:
      type: object
      required:
        - versions
      properties:
        context:
          $ref: "#/components/schemas/Context"
        versions:
          type: array
          items:
            $ref: "#/components/schemas/TableVersion"
          description: |
            List of table versions. When `descending=true`, guaranteed to be ordered from latest to oldest.
            Otherwise, ordering is implementation-defined.
        page_token:
          $ref: "#/components/schemas/PageToken"

    CreateTableVersionRequest:
      type: object
      description: |
        Request to create a new table version entry.
        This supports `put_if_not_exists` semantics,
        where the operation fails if the version already exists.
      required:
        - version
        - manifest_path
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The table identifier
        version:
          type: integer
          format: int64
          minimum: 0
          description: Version number to create
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        manifest_path:
          type: string
          description: Path to the manifest file for this version
        manifest_size:
          type: integer
          format: int64
          minimum: 0
          description: Size of the manifest file in bytes
        e_tag:
          type: string
          description: Optional ETag for the manifest file
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Optional metadata for the version
        naming_scheme:
          $ref: "#/components/schemas/ManifestNamingScheme"

    CreateTableVersionResponse:
      type: object
      description: Response for creating a table version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        version:
          $ref: "#/components/schemas/TableVersion"

    DescribeTableVersionRequest:
      type: object
      description: Request to describe a specific table version
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The table identifier
        version:
          type: integer
          format: int64
          minimum: 0
          description: Version number to describe
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.

    DescribeTableVersionResponse:
      type: object
      description: Response containing the table version information
      required:
        - version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        version:
          $ref: "#/components/schemas/TableVersion"
          description: The table version information

    BatchDeleteTableVersionsRequest:
      type: object
      description: |
        Request to delete table version records.
        Supports deleting ranges of versions for efficient bulk cleanup.
      required:
        - ranges
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: The table identifier
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        ranges:
          type: array
          items:
            $ref: "#/components/schemas/VersionRange"
          description: |
            List of version ranges to delete.
            Each range specifies start (inclusive) and end (exclusive) versions.

    VersionRange:
      type: object
      description: |
        A range of versions to delete (start inclusive, end exclusive).
        Special values:
        - `start_version: 0` with `end_version: -1` means ALL versions
      required:
        - start_version
        - end_version
      properties:
        start_version:
          type: integer
          format: int64
          description: |
            Start version of the range (inclusive).
            Use 0 to start from the first version.
        end_version:
          type: integer
          format: int64
          description: |
            End version of the range (exclusive).
            Use -1 to indicate all versions up to and including the latest.

    BatchDeleteTableVersionsResponse:
      type: object
      description: Response for deleting table version records
      properties:
        context:
          $ref: "#/components/schemas/Context"
        deleted_count:
          type: integer
          format: int64
          minimum: 0
          description: Number of version records deleted
        transaction_id:
          type: string
          description: Optional transaction identifier

    BatchCreateTableVersionsRequest:
      type: object
      description: |
        Request to atomically create new version entries for multiple tables.
        The operation is atomic: all versions are created or none are.
      required:
        - entries
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        entries:
          type: array
          items:
            $ref: "#/components/schemas/CreateTableVersionEntry"
          description: List of table version entries to create atomically

    CreateTableVersionEntry:
      type: object
      description: |
        An entry for creating a new table version in a batch operation.
        This supports `put_if_not_exists` semantics,
        where the operation fails if the version already exists.
      required:
        - id
        - version
        - manifest_path
      properties:
        id:
          type: array
          items:
            type: string
          description: The table identifier
        version:
          type: integer
          format: int64
          minimum: 0
          description: Version number to create
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        manifest_path:
          type: string
          description: Path to the manifest file for this version
        manifest_size:
          type: integer
          format: int64
          minimum: 0
          description: Size of the manifest file in bytes
        e_tag:
          type: string
          description: Optional ETag for the manifest file
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Optional metadata for the version
        naming_scheme:
          $ref: "#/components/schemas/ManifestNamingScheme"

    BatchCreateTableVersionsResponse:
      type: object
      description: |
        Response for batch creating table versions.
        Contains the created versions for each table in the same order as the request.
      required:
        - versions
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        versions:
          type: array
          items:
            $ref: "#/components/schemas/TableVersion"
          description: List of created table versions in the same order as the request entries

    BatchCommitTablesRequest:
      type: object
      description: |
        Request to atomically commit a batch of table operations.
        This replaces `BatchCreateTableVersionsRequest` with a more general interface
        that supports mixed operations (DeclareTable, CreateTableVersion,
        DeleteTableVersions, DeregisterTable)
        within a single atomic transaction at the metadata layer.

        All operations are committed atomically: either all succeed or none are applied.
      required:
        - operations
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        operations:
          type: array
          items:
            $ref: "#/components/schemas/CommitTableOperation"
          description: |
            List of operations to commit atomically.
            Supported operation types: DeclareTable, CreateTableVersion,
            DeleteTableVersions, DeregisterTable.

    CommitTableOperation:
      type: object
      description: |
        A single operation within a batch commit.
        Provide exactly one of the operation fields to specify the operation kind.
      properties:
        declare_table:
          $ref: "#/components/schemas/DeclareTableRequest"
          description: Declare (reserve) a new table in the namespace
        create_table_version:
          $ref: "#/components/schemas/CreateTableVersionRequest"
          description: Create a new version entry for a table
        delete_table_versions:
          $ref: "#/components/schemas/BatchDeleteTableVersionsRequest"
          description: Delete version ranges from a table
        deregister_table:
          $ref: "#/components/schemas/DeregisterTableRequest"
          description: Deregister (soft-delete) a table

    CommitTableResult:
      type: object
      description: |
        Result of a single operation within a batch commit.
        Each result corresponds to one operation in the request, in the same order.
        Exactly one of the result fields will be set.
      properties:
        declare_table:
          $ref: "#/components/schemas/DeclareTableResponse"
          description: Result of a DeclareTable operation
        create_table_version:
          $ref: "#/components/schemas/CreateTableVersionResponse"
          description: Result of a CreateTableVersion operation
        delete_table_versions:
          $ref: "#/components/schemas/BatchDeleteTableVersionsResponse"
          description: Result of a DeleteTableVersions operation
        deregister_table:
          $ref: "#/components/schemas/DeregisterTableResponse"
          description: Result of a DeregisterTable operation

    BatchCommitTablesResponse:
      type: object
      description: |
        Response for a batch commit of table operations.
        Contains the results of each operation in the same order as the request.
      required:
        - results
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier for the batch commit
        results:
          type: array
          items:
            $ref: "#/components/schemas/CommitTableResult"
          description: |
            Results for each operation, in the same order as the request operations.
            Each result contains the outcome of the corresponding operation.

    TableVersion:
      type: object
      required:
        - version
        - manifest_path
      properties:
        version:
          type: integer
          format: int64
          minimum: 0
          description: Version number
        manifest_path:
          type: string
          description: Path to the manifest file for this version.
        manifest_size:
          type: integer
          format: int64
          minimum: 0
          description: Size of the manifest file in bytes
        e_tag:
          type: string
          description: |
            Optional ETag for optimistic concurrency control.
            Useful for S3 and similar object stores.
        timestamp_millis:
          type: integer
          format: int64
          description: Timestamp when the version was created, in milliseconds since epoch (Unix time)
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Optional key-value pairs of metadata

    ManifestNamingScheme:
      type: string
      description: |
        The naming scheme used for manifest files in the `_versions/` directory.

        Known values:
        - `V1`: `_versions/{version}.manifest` - Simple version-based naming
        - `V2`: `_versions/{inverted_version}.manifest` - Zero-padded, reversed version number
          (uses `u64::MAX - version`) for O(1) lookup of latest version on object stores

        V2 is preferred for new tables as it enables efficient latest-version discovery
        without needing to list all versions.
      example: V2

    ExplainTableQueryPlanRequest:
      type: object
      required:
        - query
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        query:
          $ref: "#/components/schemas/QueryTableRequest"
        verbose:
          type: boolean
          default: false
          description: Whether to return verbose explanation

    ExplainTableQueryPlanResponse:
      type: object
      required:
        - plan
      properties:
        context:
          $ref: "#/components/schemas/Context"
        plan:
          type: string
          description: Human-readable query execution plan

    AnalyzeTableQueryPlanRequest:
      type: object
      required:
        - vector
        - k
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        bypass_vector_index:
          type: boolean
          description: Whether to bypass vector index
        columns:
          type: object
          nullable: true
          description: |
            Optional field paths to return. Provide either column_names or
            column_aliases, not both.
          properties:
            column_names:
              type: array
              items:
                type: string
                minLength: 1
              description: List of Lance field paths to return. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments.
            column_aliases:
              type: object
              additionalProperties:
                type: string
                minLength: 1
              description: Object mapping output aliases to source Lance field paths. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments.
        distance_type:
          type: string
          description: Distance metric to use
        ef:
          type: integer
          minimum: 0
          description: Search effort parameter for HNSW index
        fast_search:
          type: boolean
          description: Whether to use fast search
        filter:
          type: string
          description: |
            Optional SQL filter expression. Field references in the expression must use Lance field path syntax: nested fields use dot-separated segments, literal dots require backtick-quoted segments, and backticks inside quoted segments are doubled.
        full_text_query:
          type: object
          nullable: true
          description: Optional full-text search query. Provide either string_query or structured_query, not both.
          properties:
            string_query:
              $ref: "#/components/schemas/StringFtsQuery"
            structured_query:
              $ref: "#/components/schemas/StructuredFtsQuery"
        k:
          type: integer
          minimum: 0
          description: Number of results to return
        lower_bound:
          type: number
          format: float
          description: Lower bound for search
        maximum_nprobes:
          type: integer
          minimum: 1
          description: Maximum number of IVF partitions to search. When omitted, all partitions may be searched if needed.
        minimum_nprobes:
          type: integer
          minimum: 1
          description: Minimum number of IVF partitions to search before adaptive expansion.
        nprobes:
          type: integer
          minimum: 0
          description: Legacy exact number of IVF partitions to search. Ignored when minimum_nprobes or maximum_nprobes is provided.
        offset:
          type: integer
          minimum: 0
          description: Number of results to skip
        prefilter:
          type: boolean
          description: Whether to apply filtering before vector search
        refine_factor:
          type: integer
          format: int32
          minimum: 0
          description: Refine factor for search
        upper_bound:
          type: number
          format: float
          description: Upper bound for search
        vector:
          type: object
          nullable: true
          description: Query vector(s) for similarity search. Provide either single_vector or multi_vector, not both.
          properties:
            single_vector:
              type: array
              items:
                type: number
                format: float
              description: Single query vector
            multi_vector:
              type: array
              items:
                type: array
                items:
                  type: number
                  format: float
              description: Multiple query vectors for batch search
        vector_column:
          type: string
          minLength: 1
          description: Lance field path of the vector field to search. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
        version:
          type: integer
          format: int64
          minimum: 0
          description: Table version to query
        with_row_id:
          type: boolean
          description: If true, return the row id as a column called `_rowid`

    AnalyzeTableQueryPlanResponse:
      type: object
      required:
        - analysis
      properties:
        context:
          $ref: "#/components/schemas/Context"
        analysis:
          type: string
          description: Detailed analysis of the query execution plan

    AlterTableAddColumnsRequest:
      type: object
      required:
        - new_columns
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: Table identifier path (namespace + table name)
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        new_columns:
          type: array
          items:
            $ref: "#/components/schemas/AddColumnsEntry"
          description: List of new columns to add to the table

    AddColumnsEntry:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the new column
        expression:
          type:
            - string
            - "null"
          description: |-
            SQL expression for the column (optional if virtual_column or computed
            is specified). Evaluated once over existing rows; nothing is stored,
            so rows appended later read null.
        computed:
          type:
            - string
            - "null"
          description: |-
            SQL expression declaring a maintained computed column (optional if
            expression or virtual_column is specified). The column is added
            all-null with the expression persisted as its binding in field
            metadata; its type and input columns are inferred from the
            expression. Rows are filled by backfill, never at declaration.
        virtual_column:
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/AddVirtualColumnEntry"
          description: |-
            Virtual column definition (optional if expression or computed is
            specified)

    AddVirtualColumnEntry:
      type: object
      required:
        - input_columns
        - outputs
        - image
        - udf_version
        - udf_name
        - udf
      properties:
        input_columns:
          type: array
          items:
            type: string
            minLength: 1
          description: List of input Lance field paths for the virtual column. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments.
        outputs:
          type: array
          items:
            $ref: "#/components/schemas/AddVirtualColumnOutputEntry"
          description: Output columns produced by the virtual column UDF
        image:
          type: string
          description: Docker image to use for the UDF
        udf:
          type: string
          description: Base64 encoded pickled UDF
        udf_name:
          type: string
          description: Name of the UDF
        udf_version:
          type: string
          description: Version of the UDF
        udf_backend:
          type:
            - string
            - "null"
          description: UDF backend type (e.g. DockerUDFSpecV1)
        auto_backfill:
          type:
            - boolean
            - "null"
          description: Whether to automatically backfill the column after creation
        manifest:
          type:
            - string
            - "null"
          description: JSON-serialized manifest for the UDF environment
        manifest_checksum:
          type:
            - string
            - "null"
          description: SHA-256 checksum of the manifest content
        field_metadata:
          type:
            - object
            - "null"
          additionalProperties:
            type: string
          description: User-supplied field metadata (string key-value pairs)

    AddVirtualColumnOutputEntry:
      type: object
      required:
        - column
        - struct_field
        - data_type
        - nullable
      properties:
        column:
          type: string
          description: Physical output column name
        struct_field:
          type: string
          description: Field name in the UDF output struct
        data_type:
          type: object
          description: Data type of the output column using JSON representation
        nullable:
          type: boolean
          description: Whether the output column is nullable
        metadata:
          type: object
          additionalProperties:
            type: string
          propertyNames:
            type: string
          description: User-supplied output field metadata (string key-value pairs)

    AlterTableAddColumnsResponse:
      type: object
      required:
        - version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        version:
          type: integer
          format: int64
          description: The commit version associated with the operation
          minimum: 0

    UpdateFieldMetadataRequest:
      type: object
      required:
        - updates
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: Table identifier path (namespace + table name)
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        updates:
          type: array
          items:
            $ref: "#/components/schemas/UpdateFieldMetadataEntry"
          description: List of per-field metadata updates to apply

    UpdateFieldMetadataEntry:
      type: object
      required:
        - path
        - metadata
      properties:
        path:
          type: string
          minLength: 1
          description: Lance field path whose metadata to update. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
        metadata:
          type: object
          additionalProperties:
            type:
              - string
              - "null"
          description: |
            Metadata key-value pairs to apply to the field. A null value
            deletes that key.
        replace:
          type:
            - boolean
            - "null"
          description: |
            If true, replace the field's existing metadata entirely; otherwise
            merge into it (optional, defaults to false).

    UpdateFieldMetadataResponse:
      type: object
      required:
        - version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        version:
          type: integer
          format: int64
          description: The commit version associated with the operation
          minimum: 0
        fields:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: string
          description: |
            Resulting metadata for each updated field, keyed by canonical Lance field path.

    AlterTableAlterColumnsRequest:
      type: object
      required:
        - alterations
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: Table identifier path (namespace + table name)
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        alterations:
          type: array
          items:
            $ref: "#/components/schemas/AlterColumnsEntry"
          description: List of column alterations to apply to the table

    AlterColumnsEntry:
      type: object
      required:
        - path
      properties:
        path:
          type: string
          minLength: 1
          description: Lance field path to alter. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
        data_type:
          type: object
          description: New data type for the column using JSON representation (optional)
        rename:
          type:
            - string
            - "null"
          description: New name for the column (optional)
        nullable:
          type:
            - boolean
            - "null"
          description: Whether the column should be nullable (optional)
        virtual_column:
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/AlterVirtualColumnEntry"
          description: Virtual column alterations (optional)

    AlterVirtualColumnEntry:
      type: object
      properties:
        input_columns:
          type:
            - array
            - "null"
          items:
            type: string
            minLength: 1
          description: List of input Lance field paths for the virtual column. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Optional.
        image:
          type:
            - string
            - "null"
          description: Docker image to use for the UDF (optional)
        udf:
          type:
            - string
            - "null"
          description: Base64 encoded pickled UDF (optional)
        udf_name:
          type:
            - string
            - "null"
          description: Name of the UDF (optional)
        udf_version:
          type:
            - string
            - "null"
          description: Version of the UDF (optional)
        udf_backend:
          type:
            - string
            - "null"
          description: UDF backend type (e.g. DockerUDFSpecV1) (optional)
        auto_backfill:
          type:
            - boolean
            - "null"
          description: Whether to automatically backfill the column (optional)
        manifest:
          type:
            - string
            - "null"
          description: JSON-serialized manifest for the UDF environment (optional)
        manifest_checksum:
          type:
            - string
            - "null"
          description: SHA-256 checksum of the manifest content (optional)
        field_metadata:
          type:
            - object
            - "null"
          additionalProperties:
            type: string
          description: User-supplied field metadata (optional)

    AlterTableAlterColumnsResponse:
      type: object
      required:
        - version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        version:
          type: integer
          format: int64
          description: The commit version associated with the operation
          minimum: 0

    AlterTableBackfillColumnsRequest:
      type: object
      required:
        - column
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: Table identifier path (namespace + table name)
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        column:
          type: string
          minLength: 1
          description: Lance field path to backfill. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.
        where:
          type:
            - string
            - "null"
          description: Optional WHERE clause filter
        concurrency:
          type:
            - integer
            - "null"
          description: Optional concurrency override
        intra_applier_concurrency:
          type:
            - integer
            - "null"
          description: Optional intra-applier concurrency override
        min_checkpoint_size:
          type:
            - integer
            - "null"
          description: Optional minimum checkpoint size
        max_checkpoint_size:
          type:
            - integer
            - "null"
          description: Optional maximum checkpoint size
        batch_checkpoint_flush_interval_seconds:
          type:
            - number
            - "null"
          description: Optional batch checkpoint flush interval in seconds
        read_version:
          type:
            - integer
            - "null"
          description: Optional table version to read from
        task_size:
          type:
            - integer
            - "null"
          description: Optional task size
        num_frags:
          type:
            - integer
            - "null"
          description: Optional number of fragments
        checkpoint_size:
          type:
            - integer
            - "null"
          description: Optional checkpoint size
        commit_granularity:
          type:
            - integer
            - "null"
          description: Optional commit granularity
        cluster:
          type:
            - string
            - "null"
          description: Optional cluster name
        manifest:
          type:
            - string
            - "null"
          description: Optional manifest name

    AlterTableBackfillColumnsResponse:
      type: object
      required:
        - job_id
      properties:
        context:
          $ref: "#/components/schemas/Context"
        job_id:
          type: string
          description: The job ID for tracking the backfill job

    RefreshMaterializedViewRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: Table identifier path (namespace + table name)
        src_version:
          type:
            - integer
            - "null"
          description: Optional source version to refresh from
        max_rows_per_fragment:
          type:
            - integer
            - "null"
          description: Optional maximum rows per fragment
        concurrency:
          type:
            - integer
            - "null"
          description: Optional concurrency override
        intra_applier_concurrency:
          type:
            - integer
            - "null"
          description: Optional intra-applier concurrency override
        source_task_size:
          type:
            - integer
            - "null"
          description: |
            Optional number of source row ids per work item during expansion.
            Bounds per-actor memory for chunker materialized views.
        cluster:
          type:
            - string
            - "null"
          description: Optional cluster name (operational override)
        output_limit:
          type:
            - integer
            - "null"
          description: |
            Post-trim cap on view row count after expansion. Valid only for
            chunker materialized views; returns 400 if set on other kinds.
        manifest:
          type:
            - string
            - "null"
          description: |
            Optional inline JSON-serialized GenevaManifest. Operational
            override for this refresh only; does not mutate the view's
            snapshotted manifest. When omitted, the manifest stored in the
            view's metadata is used.

    RefreshMaterializedViewResponse:
      type: object
      required:
        - job_id
      properties:
        context:
          $ref: "#/components/schemas/Context"
        job_id:
          type: string
          description: The job ID for tracking the refresh job

    CreateMaterializedViewRequest:
      type: object
      required:
        - kind
        - source_query
        - output_schema
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
          description: View identifier path (namespace + view name)
        kind:
          type: string
          enum:
            - query
            - udtf
            - chunker
          description: |
            The materialized view kind.
            - `query` — plain query-backed view (no UDTF), 1:1 rows.
            - `udtf` — batch UDTF-backed view (N:M rows, full refresh).
            - `chunker`, aka 'scalar_udtf' — chunker view (1:N row expansion, incremental refresh).
        source_query:
          type: string
          description: |
            Opaque serialized representation of the source query that
            defines the view's input. The format is defined by the client;
            the namespace server stores it without interpreting it.
        output_schema:
          type: string
          description: Base64-encoded Arrow schema of the view output
        udtf_spec:
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/MaterializedViewUdtfEntry"
          description: |
            UDTF descriptor. Required when kind is `udtf` or `chunker`;
            must be null when kind is `query`.
        with_no_data:
          type: boolean
          default: true
          description: |
            If false, the server kicks off an initial refresh immediately
            after creating the view and the response includes a job ID.
        auto_refresh:
          type:
            - boolean
            - "null"
          default: false
          description: |
            If true, the view is automatically refreshed when source-table
            data changes past the deployment-level threshold. Boolean
            opt-in only; the threshold and cooldown are configured on the
            deployment, not per-view.

    MaterializedViewUdtfEntry:
      type: object
      required:
        - kind
        - udtf
        - udtf_sha
        - udtf_name
        - udtf_version
      properties:
        kind:
          type: string
          enum:
            - udtf
            - chunker
          description: |
            Discriminates a batch UDTF (`udtf`, full-overwrite refresh)
            from a chunker (`chunker`, incremental 1:N refresh). Must match
            the enclosing request's `kind`.
        udtf:
          type: string
          description: |
            Base64-encoded UDTFSpec / ChunkerSpec JSON envelope (per kind).
        udtf_sha:
          type: string
          description: SHA-256 checksum of the envelope; server validates.
        udtf_name:
          type: string
          description: Name of the UDTF
        udtf_version:
          type: string
          description: Version of the UDTF
        input_columns:
          type:
            - array
            - "null"
          items:
            type: string
            minLength: 1
          description: |
            Source Lance field paths the UDTF reads. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Null means all fields (batch UDTF only).
        partition_by:
          oneOf:
            - type: "null"
            - type: string
              minLength: 1
          description: |
            Batch UDTF only. Lance field path used as the field-value partition key for partition-parallel execution. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Mutually exclusive with `partition_by_indexed_column`.
        partition_by_indexed_column:
          oneOf:
            - type: "null"
            - type: string
              minLength: 1
          description: |
            Batch UDTF only. Lance field path with an IVF-family index used for index-based partitioning. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. The server validates the index exists at create time.
        num_cpus:
          type:
            - number
            - "null"
          description: Ray actor CPU request.
        num_gpus:
          type:
            - number
            - "null"
          description: Ray actor GPU request.
        memory:
          type:
            - integer
            - "null"
          description: Ray actor memory request, in bytes.
        error_handling:
          type:
            - object
            - "null"
          description: |
            Batch UDTF only. Serialized ErrorHandlingConfig controlling
            partition-grain fail/retry/skip behavior.
        batch:
          type:
            - boolean
            - "null"
          description: |
            Chunker only. True for a batched chunker; affects how the
            worker dispatches input rows.
        manifest:
          type:
            - string
            - "null"
          description: JSON-serialized GenevaManifest for the UDTF environment.
        manifest_checksum:
          type:
            - string
            - "null"
          description: SHA-256 checksum of the manifest content.

    CreateMaterializedViewResponse:
      type: object
      required:
        - version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        version:
          type: integer
          format: int64
          description: The commit version that created the materialized view
          minimum: 0
        job_id:
          type:
            - string
            - "null"
          description: |
            Refresh job ID, populated only when `with_no_data` was false.

    AlterTableDropColumnsRequest:
      type: object
      required:
        - columns
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        columns:
          type: array
          items:
            type: string
            minLength: 1
          description: Lance field paths to drop. Nested fields use dot-separated segments; use backtick-quoted segments for literal dots and double backticks inside quoted segments. Use canonical full paths for display and errors; leaf names alone only identify top-level fields; invalid or unresolved paths should return InvalidInput or TableColumnNotFound.

    AlterTableDropColumnsResponse:
      type: object
      required:
        - version
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier
        version:
          type: integer
          format: int64
          minimum: 0
          description: Version of the table after dropping columns

    GetTableStatsRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.

    GetTableStatsResponse:
      type: object
      required:
        - total_bytes
        - num_rows
        - num_indices
        - fragment_stats
      properties:
        context:
          $ref: "#/components/schemas/Context"
        total_bytes:
          type: integer
          format: int64
          minimum: 0
          description: The total number of bytes in the table
        num_rows:
          type: integer
          format: int64
          minimum: 0
          description: The number of rows in the table
        num_indices:
          type: integer
          format: int64
          minimum: 0
          description: The number of indices in the table
        fragment_stats:
          $ref: "#/components/schemas/FragmentStats"
          description: Statistics on table fragments

    FragmentStats:
      type: object
      required:
        - num_fragments
        - num_small_fragments
        - lengths
      properties:
        num_fragments:
          type: integer
          format: int64
          minimum: 0
          description: The number of fragments in the table
        num_small_fragments:
          type: integer
          format: int64
          minimum: 0
          description: The number of uncompacted fragments in the table
        lengths:
          $ref: "#/components/schemas/FragmentSummary"
          description: Statistics on the number of rows in the table fragments

    FragmentSummary:
      type: object
      required:
        - min
        - max
        - mean
        - p25
        - p50
        - p75
        - p99
      properties:
        min:
          type: integer
          format: int64
          minimum: 0
        max:
          type: integer
          format: int64
          minimum: 0
        mean:
          type: integer
          format: int64
          minimum: 0
        p25:
          type: integer
          format: int64
          minimum: 0
        p50:
          type: integer
          format: int64
          minimum: 0
        p75:
          type: integer
          format: int64
          minimum: 0
        p99:
          type: integer
          format: int64
          minimum: 0

    DropTableIndexRequest:
      type: object
      properties:
        identity:
          $ref: "#/components/schemas/Identity"
        context:
          $ref: "#/components/schemas/Context"
        id:
          type: array
          items:
            type: string
        branch:
          type: string
          description: |
            Branch to target. When not specified, the main branch is used.
        index_name:
          type: string
          description: Name of the index to drop

    DropTableIndexResponse:
      type: object
      description: Response for drop index operation
      properties:
        context:
          $ref: "#/components/schemas/Context"
        transaction_id:
          type: string
          description: Optional transaction identifier

    PartitionTransform:
      type: object
      description: Well-known partition transform
      required:
        - type
      properties:
        type:
          type: string
          description: Transform type (identity, year, month, day, hour, bucket, multi_bucket, truncate)
        num_buckets:
          type: integer
          description: Number of buckets for bucket transforms
        width:
          type: integer
          description: Truncation width for truncate transforms

    PartitionField:
      type: object
      description: Partition field definition
      required:
        - field_id
        - source_ids
        - result_type
      properties:
        field_id:
          type: string
          description: Unique identifier for this partition field (must not be renamed)
          example: "event_year"
        source_ids:
          type: array
          items:
            type: integer
          description: Field IDs of the source fields in the schema
          example: [1]
        transform:
          $ref: "#/components/schemas/PartitionTransform"
          description: Well-known partition transform. Exactly one of transform or expression must be specified.
        expression:
          type: string
          description: DataFusion SQL expression using col0, col1, ... as column references. Exactly one of transform or expression must be specified.
          example: "date_part('year', col0)"
        result_type:
          $ref: "#/components/schemas/JsonArrowDataType"
          description: The output type of the partition value (JsonArrowDataType format)
          example: { "type": "int32" }

    PartitionSpec:
      type: object
      description: Partition spec definition
      required:
        - id
        - fields
      properties:
        id:
          type: integer
          description: The spec version ID
          example: 1
        fields:
          type: array
          items:
            $ref: "#/components/schemas/PartitionField"
          description: Array of partition field definitions

  responses:
    ListNamespacesResponse:
      description: A list of namespaces
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ListNamespacesResponse"
          examples:
            NonEmptyResponse:
              $ref: "#/components/examples/ListNamespacesNonEmptyExample"
            EmptyResponse:
              $ref: "#/components/examples/ListNamespacesEmptyExample"

    DescribeNamespaceResponse:
      description:
        Returns a namespace, as well as any properties stored on the namespace if namespace properties
        are supported by the server.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DescribeNamespaceResponse"

    CreateNamespaceResponse:
      description: Result of creating a namespace
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CreateNamespaceResponse"

    DropNamespaceResponse:
      description: Result of dropping a namespace
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DropNamespaceResponse"

    ListTablesResponse:
      description: A list of tables
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ListTablesResponse"

    DescribeTableResponse:
      description: Table properties result when loading a table
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DescribeTableResponse"

    CountTableRowsResponse:
      description: Result of counting rows in a table
      content:
        application/json:
          schema:
            type: integer
            format: int64
            minimum: 0
            description: |
              Row count serialized transparently as a bare number for the REST namespace.
              The CountTableRowsResponse object model is used by non-REST interfaces.

    CreateTableResponse:
      description: Table properties result when creating a table
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CreateTableResponse"

    InsertIntoTableResponse:
      description: Result of inserting records into a table
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/InsertIntoTableResponse"

    MergeInsertIntoTableResponse:
      description: Result of merge insert operation
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/MergeInsertIntoTableResponse"

    RegisterTableResponse:
      description: Table properties result when registering a table
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/RegisterTableResponse"

    DescribeTransactionResponse:
      description: Response of DescribeTransaction
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DescribeTransactionResponse"

    AlterTransactionResponse:
      description: Response of AlterTransaction
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AlterTransactionResponse"

    DropTableResponse:
      description: Response of DropTable
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DropTableResponse"

    DeregisterTableResponse:
      description: Response of DeregisterTable
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DeregisterTableResponse"

    UpdateTableResponse:
      description: Update successful
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/UpdateTableResponse"

    DeleteFromTableResponse:
      description: Delete successful
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DeleteFromTableResponse"

    QueryTableResponse:
      description: Query results in Arrow IPC file format
      content:
        application/vnd.apache.arrow.file:
          schema:
            type: string
            format: binary

    CreateTableIndexResponse:
      description: Index created successfully
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CreateTableIndexResponse"

    CreateTableScalarIndexResponse:
      description: Scalar index created successfully
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CreateTableScalarIndexResponse"

    ListTableIndicesResponse:
      description: List of indices on the table
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ListTableIndicesResponse"

    DescribeTableIndexStatsResponse:
      description: Index statistics
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DescribeTableIndexStatsResponse"

    # Tag operation responses

    ListTableTagsResponse:
      description: List of table tags
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ListTableTagsResponse"

    GetTableTagVersionResponse:
      description: Tag version information
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/GetTableTagVersionResponse"

    CreateTableTagResponse:
      description: Create tag response
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CreateTableTagResponse"

    DeleteTableTagResponse:
      description: Delete tag response
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DeleteTableTagResponse"

    UpdateTableTagResponse:
      description: Update tag response
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/UpdateTableTagResponse"

    # Branch operation responses

    ListTableBranchesResponse:
      description: List of table branches
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ListTableBranchesResponse"

    CreateTableBranchResponse:
      description: Create branch response
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CreateTableBranchResponse"

    DeleteTableBranchResponse:
      description: Delete branch response
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DeleteTableBranchResponse"

    # Table operation responses

    ListTableVersionsResponse:
      description: List of table versions
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ListTableVersionsResponse"

    CreateTableVersionResponse:
      description: Result of creating a table version
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CreateTableVersionResponse"

    DescribeTableVersionResponse:
      description: Table version information
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DescribeTableVersionResponse"

    BatchDeleteTableVersionsResponse:
      description: Result of deleting table version records
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BatchDeleteTableVersionsResponse"

    BatchCreateTableVersionsResponse:
      description: Result of atomically creating table versions
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BatchCreateTableVersionsResponse"

    BatchCommitTablesResponse:
      description: Result of atomically committing a batch of mixed table operations
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/BatchCommitTablesResponse"

    ExplainTableQueryPlanResponse:
      description: Query execution plan explanation
      content:
        application/json:
          schema:
            type: string
            description: Human-readable query execution plan

    AnalyzeTableQueryPlanResponse:
      description: Query execution plan analysis
      content:
        application/json:
          schema:
            type: string
            description: Human-readable query execution plan analysis

    AlterTableAddColumnsResponse:
      description: Add columns operation result
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AlterTableAddColumnsResponse"

    UpdateFieldMetadataResponse:
      description: Field metadata update result
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/UpdateFieldMetadataResponse"

    AlterTableAlterColumnsResponse:
      description: Alter columns operation result
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AlterTableAlterColumnsResponse"

    AlterTableBackfillColumnsResponse:
      description: Backfill job accepted
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AlterTableBackfillColumnsResponse"

    RefreshMaterializedViewResponse:
      description: Refresh job accepted
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/RefreshMaterializedViewResponse"

    CreateMaterializedViewResponse:
      description: Materialized view created
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/CreateMaterializedViewResponse"

    AlterTableDropColumnsResponse:
      description: Drop columns operation result
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AlterTableDropColumnsResponse"

    GetTableStatsResponse:
      description: Table statistics
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/GetTableStatsResponse"

    RestoreTableResponse:
      description: Table restore operation result
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/RestoreTableResponse"

    RenameTableResponse:
      description: Table rename operation result
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/RenameTableResponse"

    DropTableIndexResponse:
      description: Index drop operation result
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DropTableIndexResponse"

    DeclareTableResponse:
      description: Table properties result when declaring a table
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DeclareTableResponse"

    # Error Responses

    BadRequestErrorResponse:
      description:
        Indicates a bad request error. It could be caused by an unexpected request
        body format or other forms of request validation failure, such as invalid json.
        Usually serves application/json content, although in some cases simple text/plain content might
        be returned by the server's middleware.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
          example:
            {
              "type": "/errors/bad-request",
              "title": "Malformed request",
              "status": 400,
              "detail": "",
              "instance": "/v1/namespaces",
            }

    UnauthorizedErrorResponse:
      description: Unauthorized. The request lacks valid authentication credentials for the operation.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
          example:
            {
              "type": "/errors/unauthorized-request",
              "title": "No valid authentication credentials for the operation",
              "status": 401,
              "detail": "",
              "instance": "/v1/namespaces",
            }

    ForbiddenErrorResponse:
      description: Forbidden. Authenticated user does not have the necessary permissions.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
          example:
            {
              "type": "/errors/forbidden-request",
              "title": "Not authorized to make this request",
              "status": 403,
              "detail": "",
              "instance": "/v1/namespaces",
            }

    NotFoundErrorResponse:
      description: A server-side problem that means can not find the specified resource.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
          example:
            {
              "type": "/errors/not-found-error",
              "title": "Not found Error",
              "status": 404,
              "detail": "",
              "instance": "/v1/namespaces/{ns}",
            }

    UnsupportedOperationErrorResponse:
      description: Not Acceptable / Unsupported Operation. The server does not support this operation.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
          example:
            {
              "type": "/errors/unsupported-operation",
              "title": "The server does not support this operation",
              "status": 406,
              "detail": "",
              "instance": "/v1/namespaces",
            }

    ConflictErrorResponse:
      description: The request conflicts with the current state of the target resource.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
          example:
            {
              "type": "/errors/conflict",
              "title": "The namespace has been concurrently modified",
              "status": 409,
              "detail": "",
              "instance": "/v1/namespaces/{ns}",
            }

    ServiceUnavailableErrorResponse:
      description:
        The service is not ready to handle the request. The client should wait and retry.
        The service may additionally send a Retry-After header to indicate when to retry.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
          example:
            {
              "type": "/errors/service-unavailable",
              "title": "Slow down",
              "status": 503,
              "detail": "",
              "instance": "/v1/namespaces",
            }

    ServerErrorResponse:
      description:
        A server-side problem that might not be addressable from the client
        side. Used for server 5xx errors without more specific documentation in
        individual routes.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
          example:
            {
              "type": "/errors/server-error",
              "title": "Internal Server Error",
              "status": 500,
              "detail": "",
              "instance": "/v1/namespaces",
            }

  examples:
    ListNamespacesEmptyExample:
      summary: An empty list of namespaces
      value: { "namespaces": [] }

    ListNamespacesNonEmptyExample:
      summary: A non-empty list of namespaces
      value: { "namespaces": ["accounting", "credits"] }

  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /oauth/token
          scopes: {}
    BearerAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
