Skip to content

feat(search): reconcile /search to the shipped gateway shape (wave-search) - #56

Merged
yakimoto merged 1 commit into
mainfrom
feat/search-ship-shape
Aug 18, 2026
Merged

feat(search): reconcile /search to the shipped gateway shape (wave-search)#56
yakimoto merged 1 commit into
mainfrom
feat/search-ship-shape

Conversation

@yakimoto

@yakimoto yakimoto commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The public OpenAPI spec still documents the archived monolith's search contract (POST /search with types/filters/page/sort, plus /search/quick, /search/suggest, /search/semantic). The gateway has shipped a different, richer contract (wave-search), and the spec now lies to any integrator.

What changes

  • Replaces the four stale search paths with the shipped four: POST /search (hybrid dense+sparse RRF query), POST /search/index (upsert one doc or a batch), DELETE /search/index/{id} (idempotent delete), GET /search/analytics (own-org top/zero-result/trending insights).
  • Rewrites SearchRequest to the route's real shape: query (required), namespace (streams|users|clips|transcripts|all, default streams), topK (1-100, default 20). No more types/filters/sort/page.
  • Rewrites SearchResult to the fused-hit shape (id, score, fusedScore, matchType semantic|keyword|hybrid, denseScore, sparseScore, metadata). Adds SearchResponse, SearchWebHit, SearchIndexRequest/Doc/Response, SearchDeleteResponse, SearchInsightRow, SearchAnalyticsResponse.

Why

The servers base is already https://api.wave.online/v1, so /search in the spec IS /v1/search live. The hard gate for this reconcile is that the spec describes the shipped route only — no documented capability the route does not serve. The removed monolith paths (/quick, /suggest, /semantic) no longer exist on the gateway.

Next

After this merges, the gateway re-pins its vendored copy (vendor/api-spec/pin.json SHA bump + spec:sync) so the published bytes match — a separate gateway PR.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

Medium Risk
Breaking contract change for anyone still using the documented monolith search API; spec-only but affects integrators and downstream gateway spec sync.

Overview
Aligns openapi.yaml Search with the shipped gateway (wave-search) so documented /v1/search matches production instead of the archived monolith.

Paths: Removes /search/quick, /search/suggest, and /search/semantic. Documents POST /search (hybrid dense+sparse RRF), POST /search/index, DELETE /search/index/{id} (required namespace query), and GET /search/analytics. POST /search now documents 400 / 429 / 503 and returns SearchResponse instead of a paginated envelope with facets.

Schemas: SearchRequest is now query + optional namespace + topK (no types/filters/sort/page). SearchResult is a fused hit (fusedScore, matchType, dense/sparse scores, metadata). Adds SearchResponse, SearchWebHit, index/delete/analytics request/response types, and SearchInsightRow. Legacy suggestion/facet-oriented search shapes are dropped from the documented contract (some unused component schemas may remain).

Reviewed by Cursor Bugbot for commit 03bbb77. Bugbot is set up for automated code reviews on this repo. Configure here.

Review in cubic

…arch)

The public spec still documented the archived monolith's types/filters/page shape. The
shipped route is namespace/topK hybrid search + /search/index + /search/analytics.
This replaces the four stale paths (/search, /quick, /suggest, /semantic) with the
shipped four, and rewrites SearchRequest/SearchResult to the route's actual contract.
@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_01c6a919-4d19-4d42-b854-02d334205348)

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 48 minutes

Limit details: You’ve used all 1 included review currently available under your plan. You completed 104 included PR reviews in the past 7 days; at that activity level, included reviews refill at 1 review per hour.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 49e2da00-03da-4e22-be49-df3066f3f2a6

📥 Commits

Reviewing files that changed from the base of the PR and between 2926637 and 03bbb77.

📒 Files selected for processing (1)
  • openapi.yaml

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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

@yakimoto
yakimoto merged commit 4468fda into main Aug 18, 2026
18 of 20 checks passed
@yakimoto
yakimoto deleted the feat/search-ship-shape branch August 18, 2026 13:30
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Align OpenAPI search contract with shipped wave-search gateway

📝 Documentation ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Replaces archived search routes with hybrid search, indexing, deletion, and analytics operations.
• Aligns request and ranked-result schemas with the deployed wave-search contract.
• Documents validation, rate-limit, metering, and unavailable-service behavior for hybrid queries.
Diagram

graph TD
  C["API Client"] --> S["Search API"] --> H["Hybrid Query"] --> R["Ranked Response"]
  S --> I["Index Upsert"] --> IR["Index Receipt"]
  S --> D["Index Delete"]
  S --> A["Query Analytics"]
Loading
High-Level Assessment

Directly replacing the archived contract is the appropriate approach because the documented server base resolves these paths to the live gateway, while the removed quick, suggestion, and semantic routes are no longer served. Retaining or versioning the obsolete shapes would continue misleading integrators without preserving a usable compatibility surface.

Files changed (1) +193 / -155

Documentation (1) +193 / -155
openapi.yamlReplace legacy search definitions with the deployed wave-search contract +193/-155

Replace legacy search definitions with the deployed wave-search contract

• Replaces the archived quick, suggestion, and semantic routes with hybrid search, indexing, idempotent deletion, and organization analytics operations. Reworks search requests and results around namespaces, top-K retrieval, fused dense and sparse scores, indexing receipts, and analytics insights, while documenting query error responses.

openapi.yaml

Comment thread openapi.yaml
Comment on lines +2460 to +2474
SearchIndexRequest:
type: object
required: [id, namespace, text]
properties:
id:
type: string
namespace:
type: string
enum: [streams, users, clips, transcripts]
title:
type: string
text:
type: string
metadata:
type: object

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Bug: SearchIndexRequest requires id/namespace/text even in batch mode

SearchIndexRequest (openapi.yaml:2460-2478) marks id, namespace, and text as top-level required fields, but also exposes a docs array for batch upserts. A client submitting a pure batch request ({"docs": [...]}) would fail schema validation because the top-level required singular fields are absent, forcing batch callers to send dummy/duplicate top-level values alongside docs. Split this into two distinct request shapes (e.g. a oneOf/anyOf of a single-doc schema and a batch schema with only docs required), or drop top-level required and validate the single-vs-batch invariant in prose/description only.

Use oneOf to model single-doc vs batch as mutually exclusive valid shapes:

SearchIndexRequest:
  oneOf:
    - $ref: '#/components/schemas/SearchIndexDoc'
    - type: object
      required: [docs]
      properties:
        docs:
          type: array
          items:
            $ref: '#/components/schemas/SearchIndexDoc'
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment thread openapi.yaml
Comment on lines +2515 to +2517
generated_at:
type: string
format: date-time

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: generated_at breaks camelCase convention used elsewhere

SearchAnalyticsResponse (openapi.yaml:2515-2517) introduces generated_at in snake_case, while every other timestamp field in the spec (createdAt, updatedAt, processingTimeMs) uses camelCase. Rename to generatedAt for consistency, since this isn't a documented passthrough field like the snake_case exception at line 1621.

Rename to camelCase to match the rest of the spec:

generatedAt:
  type: string
  format: date-time
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment thread openapi.yaml
Comment on lines +2534 to +2548
SearchHighlight:
type: object
properties:
field:
type: string
snippet:
type: string
positions:
type: array
items:
type: object
properties:
start:
type: integer
end:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: Orphaned schemas left over from removed search endpoints

SearchHighlight, SearchSuggestion, and SearchFacet (openapi.yaml:2534-2571 area) are no longer referenced anywhere after the monolith search paths and their response shapes (which used SearchFacet, SearchSuggestion, SearchHighlight) were removed, but the schema definitions were left in components/schemas. Delete these dead schemas to keep the spec matching only the shipped gateway contract, consistent with the PR's stated goal of not documenting capabilities the route doesn't serve.

Delete unused schemas:

# Remove the SearchHighlight, SearchSuggestion, and SearchFacet schema blocks entirely from components/schemas
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your team has used its included automatic processing for this billing period (headroom scales with your seat count). You can still comment "Gitar review" to run one anytime, and automatic reviews resume on their own by September 1. Add seats for more headroom.
Learn more

Code Review ⚠️ Changes requested 0 resolved / 3 findings

Reconciles the search OpenAPI specification with the shipped gateway endpoints, but requires fixing the SearchIndexRequest schema, camelCase naming in SearchAnalyticsResponse, and removing orphaned schemas.

⚠️ Bug: SearchIndexRequest requires id/namespace/text even in batch mode

📄 openapi.yaml:2460-2474

SearchIndexRequest (openapi.yaml:2460-2478) marks id, namespace, and text as top-level required fields, but also exposes a docs array for batch upserts. A client submitting a pure batch request ({"docs": [...]}) would fail schema validation because the top-level required singular fields are absent, forcing batch callers to send dummy/duplicate top-level values alongside docs. Split this into two distinct request shapes (e.g. a oneOf/anyOf of a single-doc schema and a batch schema with only docs required), or drop top-level required and validate the single-vs-batch invariant in prose/description only.

Use oneOf to model single-doc vs batch as mutually exclusive valid shapes
SearchIndexRequest:
  oneOf:
    - $ref: '#/components/schemas/SearchIndexDoc'
    - type: object
      required: [docs]
      properties:
        docs:
          type: array
          items:
            $ref: '#/components/schemas/SearchIndexDoc'
💡 Quality: generated_at breaks camelCase convention used elsewhere

📄 openapi.yaml:2515-2517

SearchAnalyticsResponse (openapi.yaml:2515-2517) introduces generated_at in snake_case, while every other timestamp field in the spec (createdAt, updatedAt, processingTimeMs) uses camelCase. Rename to generatedAt for consistency, since this isn't a documented passthrough field like the snake_case exception at line 1621.

Rename to camelCase to match the rest of the spec
generatedAt:
  type: string
  format: date-time
💡 Quality: Orphaned schemas left over from removed search endpoints

📄 openapi.yaml:2534-2548

SearchHighlight, SearchSuggestion, and SearchFacet (openapi.yaml:2534-2571 area) are no longer referenced anywhere after the monolith search paths and their response shapes (which used SearchFacet, SearchSuggestion, SearchHighlight) were removed, but the schema definitions were left in components/schemas. Delete these dead schemas to keep the spec matching only the shipped gateway contract, consistent with the PR's stated goal of not documenting capabilities the route doesn't serve.

Delete unused schemas
# Remove the SearchHighlight, SearchSuggestion, and SearchFacet schema blocks entirely from components/schemas
🤖 Prompt for agents
Code Review: Reconciles the search OpenAPI specification with the shipped gateway endpoints, but requires fixing the `SearchIndexRequest` schema, camelCase naming in `SearchAnalyticsResponse`, and removing orphaned schemas.

1. ⚠️ Bug: SearchIndexRequest requires id/namespace/text even in batch mode
   Files: openapi.yaml:2460-2474

   SearchIndexRequest (openapi.yaml:2460-2478) marks `id`, `namespace`, and `text` as top-level required fields, but also exposes a `docs` array for batch upserts. A client submitting a pure batch request (`{"docs": [...]}`) would fail schema validation because the top-level required singular fields are absent, forcing batch callers to send dummy/duplicate top-level values alongside `docs`. Split this into two distinct request shapes (e.g. a oneOf/anyOf of a single-doc schema and a batch schema with only `docs` required), or drop top-level `required` and validate the single-vs-batch invariant in prose/description only.

   Fix (Use oneOf to model single-doc vs batch as mutually exclusive valid shapes):
   SearchIndexRequest:
     oneOf:
       - $ref: '#/components/schemas/SearchIndexDoc'
       - type: object
         required: [docs]
         properties:
           docs:
             type: array
             items:
               $ref: '#/components/schemas/SearchIndexDoc'

2. 💡 Quality: generated_at breaks camelCase convention used elsewhere
   Files: openapi.yaml:2515-2517

   SearchAnalyticsResponse (openapi.yaml:2515-2517) introduces `generated_at` in snake_case, while every other timestamp field in the spec (createdAt, updatedAt, processingTimeMs) uses camelCase. Rename to `generatedAt` for consistency, since this isn't a documented passthrough field like the snake_case exception at line 1621.

   Fix (Rename to camelCase to match the rest of the spec):
   generatedAt:
     type: string
     format: date-time

3. 💡 Quality: Orphaned schemas left over from removed search endpoints
   Files: openapi.yaml:2534-2548

   SearchHighlight, SearchSuggestion, and SearchFacet (openapi.yaml:2534-2571 area) are no longer referenced anywhere after the monolith search paths and their response shapes (which used SearchFacet, SearchSuggestion, SearchHighlight) were removed, but the schema definitions were left in components/schemas. Delete these dead schemas to keep the spec matching only the shipped gateway contract, consistent with the PR's stated goal of not documenting capabilities the route doesn't serve.

   Fix (Delete unused schemas):
   # Remove the SearchHighlight, SearchSuggestion, and SearchFacet schema blocks entirely from components/schemas

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@cursor cursor 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.

Risk: medium. Left a non-blocking comment and did not approve: Cursor Bugbot was present but skipped (usage limit / incomplete analysis). Cursor Security Agent passed with no findings; human review is needed. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Batch indexing cannot validate 🐞 Bug ≡ Correctness
Description
SearchIndexRequest unconditionally requires the single-document fields id, namespace, and
text, so the advertised batch body containing only docs is rejected by validators and generated
clients. The schema also fails to enforce the intended choice between one document and a batch.
Code

openapi.yaml[2462]

+      required: [id, namespace, text]
Relevance

●●● Strong

The schema directly contradicts its advertised batch form; this is a concrete validator/client
correctness defect, not a subjective enhancement.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The operation says it accepts one document or a batch and references SearchIndexRequest, but that
schema requires root-level single-document fields while making docs optional.

openapi.yaml[1126-1136]
openapi.yaml[2444-2458]
openapi.yaml[2460-2478]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`SearchIndexRequest` requires single-document fields even when callers submit the documented `docs` batch form. Model the request as mutually exclusive single-document and non-empty batch alternatives.

## Issue Context
The `/search/index` operation advertises support for one document or a batch, and `SearchIndexDoc` already describes each batch element.

## Fix Focus Areas
- openapi.yaml[1126-1136]
- openapi.yaml[2444-2458]
- openapi.yaml[2460-2478]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Successful payloads validate empty 🐞 Bug ≡ Correctness
Description
SearchResponse and the new index, delete, and analytics response schemas have no required lists,
so {} validates as every documented 200 response despite descriptions promising results and
metadata, indexed count and IDs, delete status and ID, or insights. Generated SDKs consequently
expose every successful-response field as optional.
Code

openapi.yaml[R2399-2402]

+    SearchResponse:
+      type: object
+      properties:
+        results:
Relevance

●●● Strong

PR #12 accepted the same OpenAPI contract issue: documented payload data omitted from required
causes invalid validation and optional SDK fields.

PR-#12

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each operation describes named payload fields, while all four referenced schemas define only
optional properties; the repository explicitly documents SDK generation from this specification.
Past accepted reviews in this same file establish that guaranteed payload fields must appear in
required.

openapi.yaml[1113-1181]
openapi.yaml[2399-2425]
openapi.yaml[2480-2532]
README.md[18-20]
PR-#12

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new successful-response schemas allow empty objects because none declares its guaranteed top-level properties as required. Add `required` lists matching the fields always returned by the shipped gateway.

## Issue Context
The operation descriptions promise concrete response envelopes, and this repository supports generating SDK models directly from the specification.

## Fix Focus Areas
- openapi.yaml[1113-1118]
- openapi.yaml[1138-1143]
- openapi.yaml[1163-1168]
- openapi.yaml[1176-1181]
- openapi.yaml[2399-2425]
- openapi.yaml[2480-2532]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. openapi.yaml exceeds 500 lines 📘 Rule violation ⚙ Maintainability
Description
The touched OpenAPI source contains approximately 2,440 non-empty, non-comment lines, exceeding the
500-line maximum. Its size increases maintenance and review complexity.
Code

openapi.yaml[2534]

+    SearchHighlight:
Relevance

●● Moderate

The rule appears applicable, but the only matching rejection concerned a generated artifact, not a
deliberately maintained OpenAPI source file.

PR-#49

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2497975 limits every touched source file to 500 non-empty, non-comment lines. The
machine-readable OpenAPI source is 2,575 physical lines and approximately 2,440 qualifying lines,
with the changed search schemas extending through line 2549.

Rule 2497975: Limit source file length to 500 lines of code
openapi.yaml[1-2575]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The touched `openapi.yaml` contains approximately 2,440 non-empty, non-comment lines, exceeding the 500-line source-file limit.

## Issue Context
The OpenAPI contract currently combines all paths and component schemas in one 2,575-line source artifact. Extract path groups and schemas into externally referenced YAML modules while preserving the published bundled contract.

## Fix Focus Areas
- openapi.yaml[1099-1181]
- openapi.yaml[2364-2549]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. Public change lacks changelog 🐞 Bug ⚙ Maintainability
Description
This PR replaces multiple public search operations and schemas but leaves the Unreleased changelog
section empty. That omits migration-visible API changes despite the repository rule requiring
changelog updates for user-facing changes.
Code

openapi.yaml[R1126-1129]

+  /search/index:
+    post:
      tags: [Search]
-      summary: Quick search
-      operationId: quickSearch
-      parameters:
-        - name: q
-          in: query
-          required: true
-          schema:
-            type: string
-        - name: limit
-          in: query
-          schema:
-            type: integer
-            default: 10
+      summary: Index (upsert) one doc or a batch
Relevance

●●● Strong

Explicit repository guidance covers user-facing API changes, and this PR materially replaces public
search endpoints and schemas.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Repository guidance requires user-facing changes to update CHANGELOG.md, whose Unreleased
section currently contains no entries, while this diff replaces the documented public search API.

AGENTS.md[9-14]
CHANGELOG.md[1-7]
openapi.yaml[1099-1104]
openapi.yaml[1126-1181]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Record the public search endpoint and schema replacement under the changelog's `Unreleased` section.

## Issue Context
The repository requires changelog updates for user-facing changes, and this PR removes three documented operations while adding index, delete, and analytics operations.

## Fix Focus Areas
- CHANGELOG.md[1-7]
- openapi.yaml[1099-1104]
- openapi.yaml[1126-1181]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context
✅ Compliance rules (platform): 1 rule
Review mode: ⚖️ Balanced: This is a public OpenAPI contract rewrite affecting multiple search routes and schemas, with meaningful integration and compatibility risk, but the change is localized enough for one careful review pass.

Grey Divider

ⓘ  3 issues published inline · 4 in summary

Tip of the day
💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more'

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread openapi.yaml
items:
$ref: '#/components/schemas/SearchInsightRow'

SearchHighlight:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. openapi.yaml exceeds 500 lines 📘 Rule violation ⚙ Maintainability

The touched OpenAPI source contains approximately 2,440 non-empty, non-comment lines, exceeding the
500-line maximum. Its size increases maintenance and review complexity.
Agent Prompt
## Issue description
The touched `openapi.yaml` contains approximately 2,440 non-empty, non-comment lines, exceeding the 500-line source-file limit.

## Issue Context
The OpenAPI contract currently combines all paths and component schemas in one 2,575-line source artifact. Extract path groups and schemas into externally referenced YAML modules while preserving the published bundled contract.

## Fix Focus Areas
- openapi.yaml[1099-1181]
- openapi.yaml[2364-2549]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread openapi.yaml

SearchIndexRequest:
type: object
required: [id, namespace, text]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Batch indexing cannot validate 🐞 Bug ≡ Correctness

SearchIndexRequest unconditionally requires the single-document fields id, namespace, and
text, so the advertised batch body containing only docs is rejected by validators and generated
clients. The schema also fails to enforce the intended choice between one document and a batch.
Agent Prompt
## Issue description
`SearchIndexRequest` requires single-document fields even when callers submit the documented `docs` batch form. Model the request as mutually exclusive single-document and non-empty batch alternatives.

## Issue Context
The `/search/index` operation advertises support for one document or a batch, and `SearchIndexDoc` already describes each batch element.

## Fix Focus Areas
- openapi.yaml[1126-1136]
- openapi.yaml[2444-2458]
- openapi.yaml[2460-2478]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread openapi.yaml
Comment on lines +2399 to +2402
SearchResponse:
type: object
properties:
results:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

3. Successful payloads validate empty 🐞 Bug ≡ Correctness

SearchResponse and the new index, delete, and analytics response schemas have no required lists,
so {} validates as every documented 200 response despite descriptions promising results and
metadata, indexed count and IDs, delete status and ID, or insights. Generated SDKs consequently
expose every successful-response field as optional.
Agent Prompt
## Issue description
The new successful-response schemas allow empty objects because none declares its guaranteed top-level properties as required. Add `required` lists matching the fields always returned by the shipped gateway.

## Issue Context
The operation descriptions promise concrete response envelopes, and this repository supports generating SDK models directly from the specification.

## Fix Focus Areas
- openapi.yaml[1113-1118]
- openapi.yaml[1138-1143]
- openapi.yaml[1163-1168]
- openapi.yaml[1176-1181]
- openapi.yaml[2399-2425]
- openapi.yaml[2480-2532]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review

Copy link
Copy Markdown

Qodo Fixer

Found 3 findings, but none include a fix that can be applied automatically.

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.

1 participant