Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 17, 2025

Summary by CodeRabbit

  • Documentation
    • Marked several public API endpoints as deprecated in the published specification.
    • Marked specific request parameters as deprecated, including search_queries_only and web-search connector usage.
    • Deprecation notices will appear in generated docs/SDKs to guide migration.
  • Chores
    • No functional or runtime changes; updates add deprecation annotations only.
    • Existing integrations continue to work for now, but new usage is discouraged.
    • Please review affected endpoints/parameters and plan to migrate to supported alternatives.

@coderabbitai
Copy link

coderabbitai bot commented Sep 17, 2025

Walkthrough

Adds deprecated: true markers to parameters and multiple operation objects in src/libs/Cohere/openapi.yaml, deprecating specific flags and endpoints across the OpenAPI spec. No schema or runtime logic changes; only contract-level deprecation annotations were introduced.

Changes

Cohort / File(s) Summary
OpenAPI deprecations
src/libs/Cohere/openapi.yaml
Marked additional public API elements as deprecated: added deprecated: true to a ChatConnector/web-search-related parameter, to the search_queries_only parameter, and to multiple operations across several paths (e.g., sections near lines ~1002–1493, ~6614, ~7168). No model changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I thump my paws: “Deprecated, noted!”
Flags and routes, politely demoted.
The map remains, the paths grow dim,
New trails await—light, not grim.
I hop ahead, with docs aligned,
Carrots cached, release refined. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title "feat:@coderabbitai" is an attribution/tag and does not describe the pull request's primary change, which updates src/libs/Cohere/openapi.yaml to add deprecated: true to multiple operations and parameters; it therefore fails to summarize the main change or scope and is misleading for reviewers scanning history. Rename the PR to a concise, descriptive title such as "chore(openapi): mark multiple Cohere API operations and parameters as deprecated" and update the PR description with a short summary of the affected paths/parameters so reviewers can quickly see the intent and scope.
✅ 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_202509170328

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 03:29
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Mark parameters and operations as deprecated in Cohere OpenAPI 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 (10)
src/libs/Cohere/openapi.yaml (10)

168-174: Schema-level deprecation is fine; add rationale and migration hints.

Add explicit reason and replacement to improve SDK/portal clarity; consider prefixing description with “Deprecated”.

                 search_queries_only:
                   type: boolean
                   description: "Defaults to `false`.\n\nWhen `true`, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's `message` will be generated.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n"
                   deprecated: true
+                  x-deprecation-reason: "Superseded by <new flag/behavior>."
+                  x-replacement: "<replacement flag or request shape>"
                   x-fern-audiences:
                     - public

1004-1010: Operation deprecated: include sunset and migration metadata.

Add deprecation reason and a target removal date to communicate timelines.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"

1128-1134: Mirror deprecation metadata on this operation as well.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"

1198-1204: Add reason/replacement/sunset to deprecation for consistency.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"

1271-1277: Same note: enrich deprecation with actionable metadata.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"

1343-1349: Add deprecation rationale and sunset to aid client migration.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"

1421-1427: Operational deprecation: include guidance fields.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"

1501-1507: Provide migration metadata alongside deprecation.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"

6623-6629: Add reason and sunset date for this deprecated operation.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"

7178-7184: Same deprecation metadata recommendation here.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint replaced by <new path>."
+      x-replacement: "<new operationId or path>"
+      x-sunset-date: "2026-03-31"
📜 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 b6bc3d6.

⛔ 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

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.

⚠️ Potential issue

🧩 Analysis chain

Avoid $ref siblings under items (OAS 3.0); use allOf or confirm OAS 3.1. Also verify you intend to deprecate the entire connectors item, not just a specific connector variant.

  • If this spec is OpenAPI 3.0.x, $ref cannot have siblings (description, deprecated, x-*). Wrap with allOf. If it's 3.1, siblings are allowed—still confirm your generators (Fern/SDKs) support it.
  • Deprecating at the array items level marks every item deprecated. If the goal is to deprecate only the web-search connector, deprecate that specific schema/oneOf branch instead, not the entire item type.

Suggested fix (3.0‑safe):

-                items:
-                  $ref: '#/components/schemas/ChatConnector'
-                  description: "Accepts {\"id\": \"web-search\"} ... Compatible Deployments: Cohere Platform\n"
-                  deprecated: true
-                  x-fern-audiences:
-                    - public
+                items:
+                  allOf:
+                    - $ref: '#/components/schemas/ChatConnector'
+                  description: "Accepts {\"id\": \"web-search\"} ... Compatible Deployments: Cohere Platform\n"
+                  deprecated: true
+                  x-fern-audiences:
+                    - public
+                  x-deprecation-reason: "Connector array items are deprecated; prefer tool-calls or new connector API."
+                  x-replacement: "<point to new schema/field>"

Quick validation script:


🏁 Script executed:

#!/bin/bash
# Validate OAS version and run Python-based validators.
set -euo pipefail
FILE=src/libs/Cohere/openapi.yaml
echo -n "openapi version: "; awk '/^openapi:/{print $2}' "$FILE" || true
pip -q install openapi-spec-validator openapi-schema-validator pyyaml >/dev/null
python - <<'PY'
import sys, yaml
from openapi_spec_validator import validate_spec
with open("src/libs/Cohere/openapi.yaml","r") as f:
    spec=yaml.safe_load(f)
try:
    validate_spec(spec)  # Validates OAS 3.0.x
    print("openapi-spec-validator: OK (3.0.x semantics)")
except Exception as e:
    print("openapi-spec-validator: FAILED ->", e)
PY

Length of output: 294


Fix $ref siblings in OpenAPI 3.0.4 and narrow deprecation scope

Verified: openapi: 3.0.4 (openapi-spec-validator: OK). In OAS 3.0 a $ref must be the only key in its schema object — wrap the $ref in allOf (or upgrade to OAS 3.1 and confirm generator support). Also: deprecating at the array items level deprecates every connector; if only the web-search connector should be deprecated, deprecate that specific schema/oneOf branch instead.

Location: src/libs/Cohere/openapi.yaml (lines 63–69).

Suggested 3.0‑safe fix:

-                items:
-                  $ref: '#/components/schemas/ChatConnector'
-                  description: "Accepts {\"id\": \"web-search\"} ... Compatible Deployments: Cohere Platform\n"
-                  deprecated: true
-                  x-fern-audiences:
-                    - public
+                items:
+                  allOf:
+                    - $ref: '#/components/schemas/ChatConnector'
+                  description: "Accepts {\"id\": \"web-search\"} ... Compatible Deployments: Cohere Platform\n"
+                  deprecated: true
+                  x-fern-audiences:
+                    - public
+                  x-deprecation-reason: "Connector array items are deprecated; prefer tool-calls or new connector API."
+                  x-replacement: "<point to new schema/field>"
📝 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\"} ... Compatible Deployments: Cohere Platform\n"
deprecated: true
x-fern-audiences:
- public
x-deprecation-reason: "Connector array items are deprecated; prefer tool-calls or new connector API."
x-replacement: "<point to new schema/field>"
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 63 to 69, the schema uses a $ref
alongside sibling keys (invalid in OpenAPI 3.0) and marks deprecation at the
array items level (which deprecates all connectors). Fix by replacing any object
that currently contains "$ref" plus other keys with an allOf containing the $ref
and then additional schemas for the other keys (e.g., allOf: - $ref: ...; -
type/object with properties), and move the deprecated: true flag from the
overall items schema to only the specific connector branch (the web-search
schema) by adding deprecated: true inside that web-search schema/oneOf branch so
only that connector is deprecated.

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