Skip to content

updated search filters and get dataconnectors api#86

Merged
kdr merged 1 commit into
mainfrom
kdr-dataconnectors
Mar 3, 2026
Merged

updated search filters and get dataconnectors api#86
kdr merged 1 commit into
mainfrom
kdr-dataconnectors

Conversation

@kdr

@kdr kdr commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

updates

  • bump api version
  • add updated search filters (supporting segment level durations)
  • add get data connectors API

Summary by CodeRabbit

  • New Features
    • Introduced Data Connectors API endpoint to list and manage available data connectors with metadata
    • Enhanced video filtering capabilities with scope-aware parameters supporting file and segment level filtering
    • Added duration-based filtering parameters (min_duration, max_duration) to segmentation queries with built-in validation

@coderabbitai

coderabbitai Bot commented Mar 3, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The OpenAPI specification is updated from version 0.6.3 to 0.6.4, introducing a new data connectors API endpoint with corresponding schemas, enhancing video info filtering with scope awareness, and extending segmentation query parameters with duration constraints and validation rules.

Changes

Cohort / File(s) Summary
OpenAPI Specification Updates
spec/openapi.json
Version bump to 0.6.4; added /data-connectors GET endpoint with new DataConnector and DataConnectorList schemas; enhanced video_info filtering with scope field (file/segment); added min_duration and max_duration query parameters to segmentation endpoints; added 400 error responses for invalid query parameter combinations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 In specs we hop through paths so new,
Data connectors, tried and true!
With scopes and durations, filters refined,
A structured API, perfectly aligned!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the two main changes: updated search filters and data connectors API, matching the summary's key additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kdr-dataconnectors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kdr kdr requested a review from amyxst March 3, 2026 23:01

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
spec/openapi.json (1)

767-771: Extract the repeated filter query parameter into a shared component.

The long filter contract text is duplicated in two operations, which will drift over time. Define it once under components.parameters and $ref it from both endpoints.

♻️ Proposed refactor
+ "components": {
+   "parameters": {
+     "SearchFilterQueryParam": {
+       "name": "filter",
+       "in": "query",
+       "description": "JSON string containing filter criteria to constrain file search results. ...",
+       "required": false,
+       "schema": { "type": "string" }
+     }
+   },
+   ...
+ }

  "/files": {
    "get": {
      "parameters": [
...
-       { "name": "filter", "in": "query", ... }
+       { "$ref": "#/components/parameters/SearchFilterQueryParam" }
      ]
    }
  },

  "/collections/{collection_id}/videos": {
    "get": {
      "parameters": [
...
-       { "name": "filter", "in": "query", ... }
+       { "$ref": "#/components/parameters/SearchFilterQueryParam" }
      ]
    }
  }

Also applies to: 2234-2238

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@spec/openapi.json` around lines 767 - 771, Create a single reusable parameter
under components.parameters (e.g., name it "Filter" or "filter") that contains
the long description and schema { type: "string" } and required: false; then
remove the duplicated inline parameter definitions in the two operations and
replace them with a $ref to "#/components/parameters/Filter" so both endpoints
share the same definition (update any occurrences that match the long "filter"
query parameter to use components.parameters.Filter).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@spec/openapi.json`:
- Around line 8442-8456: The schema for the video filter items currently allows
incompatible combinations of "path" and "scope" (e.g.,
{"path":"has_audio","scope":"segment"}); update the JSON schema where the items
object defines "path" and "scope" enums to add conditional validation (oneOf or
if/then) that enforces valid pairs: require that if path == "has_audio" then
scope == "file", and if scope == "segment" then path == "duration_seconds"
(while preserving the existing enums and default for scope); apply the same
conditional schema to the other identical items block that defines the video
filter schema so invalid combinations fail contract validation early.
- Around line 3957-3984: The GET /data-connectors operation (operationId
listDataConnectors) returns the paginated schema DataConnectorList but has no
pagination query parameters; either add optional query parameters "limit" and
"offset" to the operation's parameters list (with appropriate types/integer
format and descriptions) so callers can control pagination, or change the
response schema to a non-paginated list type; update the OpenAPI path definition
for listDataConnectors to include the new parameters (or replace the response
$ref) and ensure the components schema reference (DataConnectorList) remains
consistent with the chosen approach.

---

Nitpick comments:
In `@spec/openapi.json`:
- Around line 767-771: Create a single reusable parameter under
components.parameters (e.g., name it "Filter" or "filter") that contains the
long description and schema { type: "string" } and required: false; then remove
the duplicated inline parameter definitions in the two operations and replace
them with a $ref to "#/components/parameters/Filter" so both endpoints share the
same definition (update any occurrences that match the long "filter" query
parameter to use components.parameters.Filter).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2c98f5e and 63aa4fe.

📒 Files selected for processing (1)
  • spec/openapi.json

Comment thread spec/openapi.json
Comment on lines +3957 to +3984
"get": {
"tags": ["Data Connectors"],
"summary": "List all data connectors",
"operationId": "listDataConnectors",
"description": "List all active data connectors configured for your account",
"responses": {
"200": {
"description": "A list of data connectors",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DataConnectorList"
}
}
}
},
"500": {
"description": "An unexpected error occurred on the server",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

/data-connectors uses a paginated response shape but exposes no pagination inputs.

DataConnectorList requires limit and offset, but this operation has no corresponding query params. Either add limit/offset inputs or switch to a non-paginated response schema.

🛠️ Proposed fix (add pagination params)
    "/data-connectors": {
      "get": {
        "tags": ["Data Connectors"],
        "summary": "List all data connectors",
        "operationId": "listDataConnectors",
        "description": "List all active data connectors configured for your account",
+       "parameters": [
+         {
+           "name": "limit",
+           "in": "query",
+           "description": "Maximum number of data connectors to return",
+           "required": false,
+           "schema": {
+             "type": "integer",
+             "minimum": 1,
+             "maximum": 100,
+             "default": 50
+           }
+         },
+         {
+           "name": "offset",
+           "in": "query",
+           "description": "Number of data connectors to skip",
+           "required": false,
+           "schema": {
+             "type": "integer",
+             "minimum": 0,
+             "default": 0
+           }
+         }
+       ],
        "responses": {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@spec/openapi.json` around lines 3957 - 3984, The GET /data-connectors
operation (operationId listDataConnectors) returns the paginated schema
DataConnectorList but has no pagination query parameters; either add optional
query parameters "limit" and "offset" to the operation's parameters list (with
appropriate types/integer format and descriptions) so callers can control
pagination, or change the response schema to a non-paginated list type; update
the OpenAPI path definition for listDataConnectors to include the new parameters
(or replace the response $ref) and ensure the components schema reference
(DataConnectorList) remains consistent with the chosen approach.

Comment thread spec/openapi.json
Comment on lines +8442 to +8456
"description": "Filter by video information. Use scope 'file' for source video properties or 'segment' for segment properties (e.g. segment duration).",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"enum": ["duration_seconds", "has_audio"],
"description": "JSON path on video_info object (e.g. 'has_audio', 'duration_seconds')"
},
"scope": {
"type": "string",
"enum": ["file", "segment"],
"default": "file",
"description": "Scope of the filter. 'file' filters by source video properties, 'segment' filters by segment properties. Only duration_seconds is supported with segment scope."
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

scope/path compatibility is documented but not enforced by schema.

Line 8455 and Line 10655 state has_audio is file-scope only, but the schema still allows { "scope": "segment", "path": "has_audio" }. Add conditional validation (oneOf) so invalid combinations fail contract validation early.

Also applies to: 10638-10656

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@spec/openapi.json` around lines 8442 - 8456, The schema for the video filter
items currently allows incompatible combinations of "path" and "scope" (e.g.,
{"path":"has_audio","scope":"segment"}); update the JSON schema where the items
object defines "path" and "scope" enums to add conditional validation (oneOf or
if/then) that enforces valid pairs: require that if path == "has_audio" then
scope == "file", and if scope == "segment" then path == "duration_seconds"
(while preserving the existing enums and default for scope); apply the same
conditional schema to the other identical items block that defines the video
filter schema so invalid combinations fail contract validation early.

@kdr kdr merged commit f1fb4ba into main Mar 3, 2026
1 check passed
@kdr kdr deleted the kdr-dataconnectors branch March 3, 2026 23:21
@coderabbitai coderabbitai Bot mentioned this pull request Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants