Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 17, 2025

Summary by CodeRabbit

  • Documentation
    • Marked select API operations and parameters as deprecated in the OpenAPI documentation, including a connector-related parameter and the search_queries_only flag.
    • Added deprecation notices to nine operations to clearly signal upcoming phase-out in client-facing docs and tools.
  • Chores
    • Updated deprecation metadata to improve visibility in generated SDKs and API explorers.
    • No runtime or behavior changes; impacts documentation and tooling only.

@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

Walkthrough

The OpenAPI spec file src/libs/Cohere/openapi.yaml adds deprecation flags to two parameters and nine operations. No functional logic, schemas, or non-deprecation attributes were changed.

Changes

Cohort / File(s) Summary of Changes
OpenAPI deprecations
src/libs/Cohere/openapi.yaml
Marked two parameters as deprecated: true (array of #/components/schemas/ChatConnector items; boolean search_queries_only) and added deprecated: true to nine operation declarations across multiple paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I twitch my whiskers at YAML’s lore,
Nine routes retired, two params no more.
Deprecation carrots neatly aligned,
Specs pruned tidy, by design.
Thump-thump—onward to what’s next,
A rabbit approves this well-groomed text. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is not descriptive of the changes in this PR; the changeset updates the Cohere OpenAPI spec to mark specific parameters and multiple operations as deprecated. The title reads like a bot mention or tag and does not communicate the primary change to reviewers, so it is ambiguous. Therefore the title is inconclusive with respect to summarizing the main change. Please update the PR title to a short, specific summary of the change, for example "openapi: mark deprecated parameters and operations in Cohere spec" or "chore(openapi): deprecate ChatConnector param and search_queries_only flag"; avoid bot mentions or emojis and include the affected scope so reviewers immediately understand the intent. After renaming, the title should clearly reflect the main change (deprecations in the OpenAPI file) and be ready for review.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202509170137

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.

@HavenDV HavenDV enabled auto-merge (squash) September 17, 2025 01:38
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add deprecation flags to 2 params and 9 ops in Cohere OpenAPI spec Sep 17, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (9)
src/libs/Cohere/openapi.yaml (9)

168-174: LGTM; property-level deprecation is correct

Deprecating search_queries_only at the schema property level is valid. Consider adding a vendor extension with the reason and replacement for SDKs/docs.

Example:

x-deprecation-reason: "Superseded by `search_mode`."
x-replaced-by: "search_mode"
x-sunset: "2025-12-31"

1007-1010: Operation correctly marked deprecated; add guidance

Add x-deprecation-reason, x-replaced-by, and, if applicable, a Sunset timeline to aid clients and docs.


1131-1134: Same as above: deprecation is fine; include reason/replacement

Provide clients a migration path via vendor extensions and docs.


1201-1204: Add deprecation metadata for SDK/doc generation

Reason, replacement, and sunset date help automate warnings and upgrade guides.


1274-1277: OK to deprecate; consider Sunset header in gateway

Keep deprecated: true here; also plan a Sunset response header operationally.


1346-1349: Deprecation acknowledged; add migration hint

Include x-replaced-by with the new path/operationId.


1504-1507: Deprecation flag set; tag with reason

Short rationale improves generated docs.


6626-6629: Consistent; add x-older-than/version note if you use it internally

Keeps internal tooling consistent across deprecations.


7181-7184: Final deprecation hunk: OK

No issues; same suggestion to add reason/replacement.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 111c2a6 and 9e1bda5.

⛔ Files ignored due to path filters (21)
  • src/libs/Cohere/Generated/Cohere.CohereClient.Chat.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.CohereClient.Classify.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.CohereClient.Generate.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.CohereClient.Summarize.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.CreateConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.DeleteConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.GetConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.ListConnectors.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.OAuthAuthorizeConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ConnectorsClient.UpdateConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Chat.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Classify.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Generate.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.ICohereClient.Summarize.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.CreateConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.DeleteConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.GetConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.ListConnectors.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.OAuthAuthorizeConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.IConnectorsClient.UpdateConnector.g.cs is excluded by !**/generated/**
  • src/libs/Cohere/Generated/Cohere.Models.ChatRequest.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Cohere/openapi.yaml (11 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test / Build, test and publish
🔇 Additional comments (1)
src/libs/Cohere/openapi.yaml (1)

1424-1427: Good; mirror the change in changelog/release notes

Ensure consumers are notified in release comms.

Comment on lines 63 to 69
items:
$ref: '#/components/schemas/ChatConnector'
description: "Accepts `{\"id\": \"web-search\"}`, and/or the `\"id\"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"
deprecated: true
x-fern-audiences:
- public
conversation_id:
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

🧩 Analysis chain

Do not place siblings next to $ref; deprecation here will be ignored by spec tools

deprecated, description, and x-fern-audiences are siblings of $ref under items. In OpenAPI, sibling keywords next to $ref are ignored by compliant tooling. Use allOf or move deprecation to the parent property/schema you intend to phase out.

Apply one of these:

Option A — wrap with allOf to retain annotations on the item schema:

-                items:
-                  $ref: '#/components/schemas/ChatConnector'
-                  description: "Accepts {\"id\": \"web-search\"}, and/or the \"id\" for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"
-                  deprecated: true
-                  x-fern-audiences:
-                    - public
+                items:
+                  allOf:
+                    - $ref: '#/components/schemas/ChatConnector'
+                    - description: "Accepts {\"id\": \"web-search\"}, and/or the \"id\" for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"
+                      deprecated: true
+                      x-fern-audiences:
+                        - public

Option B — if the intent is to deprecate the whole connectors property (not just the item type), put deprecated: true at the array property level instead of under items.

Run a quick lint to catch $ref-sibling issues and any schema violations:


🏁 Script executed:

#!/bin/bash
# Validate and lint the spec
npx --yes @redocly/cli@latest lint src/libs/Cohere/openapi.yaml || true
npx --yes [email protected] validate src/libs/Cohere/openapi.yaml

Length of output: 8748


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file="src/libs/Cohere/openapi.yaml"
if [ ! -f "$file" ]; then
  echo "MISSING_FILE: $file not found"
  exit 0
fi

echo "Searching for $ref blocks that include 'deprecated' or 'x-fern-audiences' within the following 12 lines..."
rg -n '\$ref:' "$file" | cut -d: -f1 | uniq | while read -r ln; do
  sed -n "${ln},$((ln+12))p" "$file" > /tmp/block.txt
  if rg -q 'deprecated:|x-fern-audiences:|x-fern-audience' /tmp/block.txt; then
    echo "---- match starting at line $ln ----"
    nl -ba -v $ln -w 6 -s' ' /tmp/block.txt
    echo
  fi
done

echo
echo "Searching for 'items:' blocks where $ref appears in the same block (possible $ref siblings under items)..."
rg -nU --pcre2 'items:\n(?:\s+.+\n){0,12}\s+\$ref:' "$file" || true

echo
echo "Snippet around lint error reported by redocly (~line 13940):"
start=13930
end=13960
sed -n "${start},${end}p" "$file" | nl -ba -v $start -w 6 -s' '

Length of output: 40


🏁 Script executed:

#!/bin/bash
file="src/libs/Cohere/openapi.yaml"
if [ ! -f "$file" ]; then
  echo "MISSING_FILE: $file not found"
  exit 0
fi

python3 - <<'PY'
import os
f='src/libs/Cohere/openapi.yaml'
with open(f,'r',encoding='utf-8') as fh:
    lines=fh.readlines()

matches = []
for i,line in enumerate(lines):
    if line.lstrip().startswith('items:'):
        block = lines[i:i+20]
        has_ref = any('$ref:' in l for l in block)
        has_depr = any('deprecated:' in l for l in block)
        has_desc = any('description:' in l for l in block)
        has_x = any('x-fern-audiences' in l or 'x-fern-audience' in l for l in block)
        if has_ref and (has_depr or has_x or has_desc):
            matches.append((i+1, block))

if not matches:
    # fallback: look for any $ref with deprecated/x-fern-audiences within +/-8 lines
    for i,line in enumerate(lines):
        if '$ref:' in line:
            start=max(0,i-8)
            end=min(len(lines), i+9)
            block = lines[start:end]
            has_depr = any('deprecated:' in l for l in block)
            has_x = any('x-fern-audiences' in l or 'x-fern-audience' in l for l in block)
            has_desc = any('description:' in l for l in block)
            if has_depr or has_x or has_desc:
                matches.append((start+1, block))

if not matches:
    print('NO_MATCHES_FOUND')
else:
    for start,block in matches:
        print('---- match starting at line', start, '----')
        for idx,ln in enumerate(block, start=start):
            print(f'{idx:6d} {ln.rstrip()}')
        print()
PY

Length of output: 84195


Do not place siblings next to $ref — wrap items with allOf or mark the array deprecated (src/libs/Cohere/openapi.yaml: lines 63–69)

Sibling keys (description / deprecated / x-fern-audiences) next to $ref are ignored by OpenAPI tooling. Apply one of the two fixes below.

Option A — wrap with allOf to retain annotations on the item schema:

-                items:
-                  $ref: '#/components/schemas/ChatConnector'
-                  description: "Accepts {\"id\": \"web-search\"}, and/or the \"id\" for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"
-                  deprecated: true
-                  x-fern-audiences:
-                    - public
+                items:
+                  allOf:
+                    - $ref: '#/components/schemas/ChatConnector'
+                    - description: "Accepts {\"id\": \"web-search\"}, and/or the \"id\" for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"
+                      deprecated: true
+                      x-fern-audiences:
+                        - public

Option B — if the whole connectors array is being deprecated, move deprecated: true to the array property (the connectors: level) instead of under items.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
items:
$ref: '#/components/schemas/ChatConnector'
description: "Accepts `{\"id\": \"web-search\"}`, and/or the `\"id\"` for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"
deprecated: true
x-fern-audiences:
- public
conversation_id:
items:
allOf:
- $ref: '#/components/schemas/ChatConnector'
- description: "Accepts {\"id\": \"web-search\"}, and/or the \"id\" for a custom [connector](https://docs.cohere.com/docs/connectors), if you've [created](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) one.\n\nWhen specified, the model's reply will be enriched with information found by querying each of the connectors (RAG).\n\nCompatible Deployments: Cohere Platform\n"
deprecated: true
x-fern-audiences:
- public
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 63 to 69, the schema under the
array items places sibling keys (description / deprecated / x-fern-audiences)
alongside a $ref which OpenAPI ignores; fix by either wrapping the referenced
schema in an allOf and moving the description/deprecated/x-fern-audiences into
that allOf entry so the annotations are applied, or (if the entire connectors
array is being deprecated) remove deprecated from items and instead set
deprecated: true on the connectors array property itself; implement one of these
two fixes so no sibling keys live next to $ref.

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