get:
  x-eov-operation-id: listDataTables
  x-eov-operation-handler: v1/handlers/data-tables/data-tables.handler
  tags:
    - DataTable
  summary: List all data tables
  description: Retrieve a list of all data tables with optional filtering, sorting, and pagination.
  operationId: list-data-tables
  parameters:
    - $ref: '../../../../shared/spec/parameters/limit.yml'
    - $ref: '../../../../shared/spec/parameters/cursor.yml'
    - name: filter
      in: query
      description: JSON string of filter conditions
      schema:
        type: string
        format: jsonString
      example: '{"name":"my-table"}'
    - name: sortBy
      in: query
      description: 'Sort format: field:asc or field:desc'
      schema:
        type: string
      example: 'name:asc'
  responses:
    '200':
      description: Successfully retrieved data tables
      content:
        application/json:
          schema:
            $ref: '../schemas/dataTableList.yml'
    '400':
      $ref: '../../../../shared/spec/responses/badRequest.yml'
    '401':
      $ref: '../../../../shared/spec/responses/unauthorized.yml'
  security:
    - ApiKeyAuth: []

post:
  x-eov-operation-id: createDataTable
  x-eov-operation-handler: v1/handlers/data-tables/data-tables.handler
  tags:
    - DataTable
  summary: Create a new data table
  description: Create a new data table in your personal project or a team project you have access to.
  operationId: create-data-table
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../schemas/createDataTableRequest.yml'
        examples:
          personalProject:
            summary: Default (personal project)
            value:
              name: 'customers'
              columns:
                - name: 'email'
                  type: 'string'
                - name: 'status'
                  type: 'string'
                - name: 'age'
                  type: 'number'
          scopedProject:
            summary: Explicit project
            value:
              name: 'customers'
              projectId: 'a1b2c3d4'
              columns:
                - name: 'email'
                  type: 'string'
                - name: 'status'
                  type: 'string'
  responses:
    '201':
      description: Data table created successfully
      content:
        application/json:
          schema:
            $ref: '../schemas/dataTable.yml'
    '400':
      $ref: '../../../../shared/spec/responses/badRequest.yml'
    '401':
      $ref: '../../../../shared/spec/responses/unauthorized.yml'
    '403':
      $ref: '../../../../shared/spec/responses/forbidden.yml'
    '409':
      $ref: '../../../../shared/spec/responses/conflict.yml'
  security:
    - ApiKeyAuth: []
