Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 17, 2025

Summary by CodeRabbit

  • Documentation

    • Marked multiple API endpoints as deprecated in the OpenAPI specification. These deprecation flags will surface in generated docs and client SDKs.
    • Flagged two parameters as deprecated: the connector selection parameter (accepting “web-search” or a custom connector id) and the boolean parameter search_queries_only.
  • Chores

    • Standardized deprecation annotations across operations (including those associated with timeout responses) to ensure consistent visibility of deprecated endpoints for API consumers.

Copy link

coderabbitai bot commented Sep 17, 2025

Walkthrough

Added deprecation flags in src/libs/Cohere/openapi.yaml: marked two parameters as deprecated and set deprecated: true on multiple operations across the spec, notably around sections following 504 GatewayTimeout/ServiceUnavailable references.

Changes

Cohort / File(s) Summary
OpenAPI parameter deprecations
src/libs/Cohere/openapi.yaml
Marked two parameters as deprecated: the connector identifier parameter (accepts {"id": "web-search"} or custom connector id) and the boolean parameter search_queries_only.
OpenAPI operation deprecations
src/libs/Cohere/openapi.yaml
Added deprecated: true to multiple operations across the spec, particularly in blocks following 504 GatewayTimeout and ServiceUnavailable references.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A rabbit taps the spec with care,
Leaves “deprecated” flags everywhere.
Two params bow, endpoints sigh—
Sunset colors in YAML sky.
I nibble docs, then hop away,
Future paths marked for another day. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title "feat:@coderabbitai" is not a clear, descriptive summary of the changes in this PR; it references a bot/handle rather than the actual modification. The PR primarily marks parameters and multiple operations as deprecated in src/libs/Cohere/openapi.yaml, which the title does not convey. Because it fails to summarize the main change or help a reviewer quickly understand intent, it does not meet the title guidelines. Please replace the title with a concise, single-sentence description of the main change. Examples: "chore(cohere): mark OpenAPI parameters and operations as deprecated in src/libs/Cohere/openapi.yaml" or "docs(openapi): deprecate web-search connector and search_queries_only in Cohere spec". Remove the bot/handle and keep the title short and specific so reviewers can understand the PR at a glance.
✅ 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_202509172117

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 21:18
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Deprecate two parameters and operations in Cohere openapi.yaml 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)

63-69: Clarify deprecation intent and add sunset metadata

Good to mark this property deprecated. Add explicit rationale/timeline so SDKs/docs can surface it, and verify the deprecated flag is applied at the correct object level (Schema vs Parameter).

Apply a lightweight extension for visibility:

                   description: "Accepts {\"id\": \"web-search\"}, and/or the \"id\" for a custom connector...\nCompatible Deployments: Cohere Platform\n"
                   deprecated: true
+                  x-deprecation-reason: "Replaced by a newer field/flow. Please migrate."
+                  x-sunset-date: "YYYY-MM-DD"
                   x-fern-audiences:

168-174: Deprecate with guidance; confirm replacement path

Flagging search_queries_only as deprecated is fine. Provide the migration path and sunset to prevent consumer confusion.

Suggested additions:

                 description: "Defaults to `false`... Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n"
                 deprecated: true
+                x-deprecation-reason: "Superseded by a more granular request option."
+                x-sunset-date: "YYYY-MM-DD"
                 x-fern-audiences:

1004-1010: Operation-level deprecation: include reason/sunset and check SDK regeneration

Marking the operation deprecated is valid. Add reason/sunset so generators and docs surface timelines; ensure regenerating SDKs preserves operationId and adds @deprecated.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Endpoint will be removed; use the replacement route."
+      x-sunset-date: "YYYY-MM-DD"
       x-fern-audiences:

1128-1134: Add deprecation metadata (reason/sunset) here as well

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "See migration guide for the new operation."
+      x-sunset-date: "YYYY-MM-DD"
       x-fern-audiences:

1198-1204: Consistent deprecation annotations across operations

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Planned removal."
+      x-sunset-date: "YYYY-MM-DD"
       x-fern-audiences:

1271-1277: Surface migration details in spec

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Superseded by updated API surface."
+      x-sunset-date: "YYYY-MM-DD"
       x-fern-audiences:

1343-1349: Deprecation metadata missing

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Consolidated into a different endpoint."
+      x-sunset-date: "YYYY-MM-DD"
       x-fern-audiences:

1421-1427: Same treatment: add reason/sunset for docs and SDKs

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Deprecated in favor of new flow."
+      x-sunset-date: "YYYY-MM-DD"
       x-fern-audiences:

1501-1507: Include migration hints

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Use the recommended replacement."
+      x-sunset-date: "YYYY-MM-DD"
       x-fern-audiences:

6623-6629: Late-spec section: ensure no unintended mass deprecation

Double-check this block wasn’t added by a bulk edit to the wrong operation. Add reason/sunset if intentional.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Intentional deprecation."
+      x-sunset-date: "YYYY-MM-DD"
       x-fern-audiences:
📜 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 6c9da22.

⛔ 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 7178 to 7184
$ref: '#/components/responses/ServiceUnavailable'
'504':
$ref: '#/components/responses/GatewayTimeout'
deprecated: true
x-fern-audiences:
- public
x-fern-examples:
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

Verify operation scope and lint the spec

Add reason/sunset; also run linters to ensure deprecated keys are at valid levels and no duplicate description keys exist nearby.

Run:


🏁 Script executed:

#!/bin/bash
# Lint OpenAPI and enumerate all deprecations
set -euo pipefail

# Show deprecated fields with context
rg -nC2 $'\\bdeprecated:\\s*true\\b' src/libs/Cohere/openapi.yaml

# Optional: Redocly or Spectral if available
if command -v npx >/dev/null 2>&1; then
  npx -y @redocly/cli@latest lint src/libs/Cohere/openapi.yaml || true
  npx -y @stoplight/spectral-cli@latest lint -F warn src/libs/Cohere/openapi.yaml || true
fi

# Confirm info.version was bumped for this deprecation change
rg -nC1 $'^info:\\n|^version:\\s*' src/libs/Cohere/openapi.yaml

Length of output: 12505


Fix OpenAPI validation error(s) and add deprecation metadata

redocly lint: 1 error, 20 warnings — address before merging.

  • Schema type mismatch — src/libs/Cohere/openapi.yaml @ #/components/schemas/EmbedByTypeResponse/properties/embeddings (lines ~13947–13956): 'type: object' contains 'items'. Convert this node to a proper array schema (type: array + items) or remove the items from the object.
  • Undefined required properties — define or remove required keys referenced but not declared (examples: CreateConnectorOAuth.required clientId/clientSecret/authorizeUrl/tokenUrl at ~13570–13576; EmbedByTypeResponse.required api_version at ~13941; EmbedFloatsResponse.required api_version at ~15253; requestBody required finetuned_model at ~6341; other similar warnings shown by the linter).
  • Unused components — remove or reference unused components listed by the linter (e.g., CreateClusterJobRequest/Response ~13520/13559; FeedbackResponse ~16497; GetConnectorsLogsResponse ~16828; ListClusterJobsResponse ~17056).
  • Deprecations and descriptions — many items are marked deprecated: true (examples at lines 64–66, 169–172, 860–863, 1007–1008, 7179–7182). Add a deprecation reason/sunset field using a consistent approach (e.g., x-deprecation-reason / x-deprecation-sunset or explicit description text), ensure deprecated is applied at the correct schema/operation/response level, and remove any duplicate description keys nearby.
  • After fixes, re-run linters and confirm info.version was bumped: npx @redocly/cli@latest lint src/libs/Cohere/openapi.yaml && npx @stoplight/spectral-cli@latest lint -F warn src/libs/Cohere/openapi.yaml
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 7178–7184, the OpenAPI spec has
multiple lint failures: convert EmbedByTypeResponse.properties.embeddings from
an object-with-items to a proper array schema (type: array + items), add or
remove undefined required properties (e.g.,
CreateConnectorOAuth.clientId/clientSecret/authorizeUrl/tokenUrl,
EmbedByTypeResponse.api_version, EmbedFloatsResponse.api_version, requestBody
finetuned_model and any other required keys referenced but not declared), remove
or reference unused component schemas listed by the linter
(CreateClusterJobRequest/Response, FeedbackResponse, GetConnectorsLogsResponse,
ListClusterJobsResponse, etc.), and add consistent deprecation metadata (use
x-deprecation-reason and/or x-deprecation-sunset or explicit description text)
for items marked deprecated while ensuring deprecated is applied at the correct
level and duplicate description keys are removed; after making these edits, bump
info.version and re-run the linters: npx @redocly/cli@latest lint
src/libs/Cohere/openapi.yaml && npx @stoplight/spectral-cli@latest lint -F warn
src/libs/Cohere/openapi.yaml to confirm all errors/warnings are resolved.

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