Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 16, 2025

Summary by CodeRabbit

  • Documentation
    • Marked several Cohere API elements as deprecated in the OpenAPI spec.
      • Deprecated the parameter referencing ChatConnector options.
      • Deprecated the boolean parameter search_queries_only.
      • Deprecated multiple endpoints associated with 504 Gateway Timeout responses.
    • No functional/runtime behavior changes for existing users.

@coderabbitai
Copy link

coderabbitai bot commented Sep 16, 2025

Walkthrough

Marked specific parameters and multiple operations as deprecated in src/libs/Cohere/openapi.yaml by adding deprecated: true. Targets include the ChatConnector options parameter (items), the search_queries_only boolean parameter, and several endpoints that include a 504 GatewayTimeout response. No other changes.

Changes

Cohort / File(s) Summary of Changes
OpenAPI deprecation flags
src/libs/Cohere/openapi.yaml
Added deprecated: true to: (1) parameter with items referencing ChatConnector schema, (2) search_queries_only boolean parameter, and (3) multiple operations that include a 504 GatewayTimeout response. No other spec edits.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I twitch my nose at specs that age,
With gentle paws, I mark the page.
“Deprecated,” I softly write—
Old paths dim, new ones bright.
Carrot ink and careful art,
Hop along, a fresher start. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The PR title "feat:@coderabbitai" is not a clear, descriptive summary of the changes; it reads like a bot/mention token rather than describing the main change (marking OpenAPI elements as deprecated). A reviewer looking at the branch or history would not know the primary intent from this title alone. Therefore the title is vague and does not meet the project's guideline for concise, meaningful PR titles. Please replace the title with a short, descriptive one-line summary of the primary change, for example "chore(openapi): mark ChatConnector parameter and search_queries_only as deprecated" or "docs(openapi): deprecate endpoints returning 504"; ensure it is a concise sentence that highlights the main change and remove bot handles or unrelated tokens.
✅ 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_202509160631

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 16, 2025 06:32
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Deprecate params and 504-response operations in Cohere openapi.yaml Sep 16, 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: 2

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

1128-1134: Repeat deprecation metadata consistently.

Mirror the same deprecation rationale vendor field here for consistent docs across SDKs and portals.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Superseded operation; refer to migration guidance."

1198-1204: Add a deprecation rationale.

Surface a short message so generators can annotate the method with actionable notes.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Deprecated; use the replacement endpoint."

1271-1277: Doc-quality polish for deprecation.

Same as above—include a reason to aid developers scanning generated SDK docs.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Deprecated; see docs for alternatives."

1343-1349: Consistent deprecation messaging.

Apply the same x-deprecation-reason pattern here.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Deprecated operation."

1421-1427: Optional: include planned removal timeline (vendor field).

If you have an internal EOL date, expose it via a vendor key (e.g., x-sunset) to help clients plan. If not, skip.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Deprecated operation."
+      x-sunset: "YYYY-MM-DD"

1501-1507: Same deprecation rationale as siblings.

Keep messaging uniform across all deprecated operations.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Deprecated operation."

1004-1010: Operation-level deprecation: add guidance for consumers.

Multiple operations in src/libs/Cohere/openapi.yaml are marked deprecated: true (examples: lines 1005–1008, 1129–1132, 1199–1202, 1272–1275, 1344–1347, 1422–1425, 1502–1505, 6624–6627, 7179–7182). Add a short deprecation sentence in each operation's description or add an x-deprecation-reason so SDKs/docs show migration steps. Keep 5xx responses unchanged.

If there’s no description yet, append one:

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "This endpoint is superseded by a newer path; see API docs for migration."

Validate:

rg -nC2 $'^\\s*deprecated:\\s*true\\b' src/libs/Cohere/openapi.yaml

63-69: Mark the parameter as deprecated (not only the schema).

OpenAPI 3.0.4 allows deprecated on both Schema and Parameter objects. (spec.openapis.org) If your intent is to deprecate the parameter (not just the array/schema), add deprecated: true on the Parameter Object where name: connectors is declared and include a short vendor note (x-deprecation-reason) so SDKs/docs surface migration guidance.

Location: src/libs/Cohere/openapi.yaml (around lines 63–69 — deprecated: true is currently on the schema/$ref).

Suggested docs vendor note (optional):

                   description: "Accepts ... (RAG).\n\nCompatible Deployments: Cohere Platform\n"
                   deprecated: true
+                  x-deprecation-reason: "Connectors via this field are being phased out; see migration guidance."
📜 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 53cc06a.

⛔ 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)

6623-6629: Large spec section — deprecated is operation-scoped.

Confirmed deprecated: true is at src/libs/Cohere/openapi.yaml:6626 at the same indentation level as operation properties (responses), so it deprecates only that operation, not the entire path.

Comment on lines 168 to 174
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-fern-audiences:
- public
seed:
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

Include a deprecation note and confirm behavior consistency.

search_queries_only is now deprecated. Add a one‑line reason so clients know the alternative, and verify server behavior remains backward‑compatible while deprecated.

You can append a reason:

                   deprecated: true
+                  x-deprecation-reason: "Use the new queries-inspection workflow; this flag will be removed in a future release."

And lint the spec:


🏁 Script executed:

#!/bin/bash
npx -y @redocly/cli@latest lint src/libs/Cohere/openapi.yaml

Length of output: 8369


Add a deprecation note for search_queries_only and fix OpenAPI lint failures.

Add the one-line deprecation reason below, then fix the linter error(s) and warnings and re-run the linter.

Suggested diff:

                   deprecated: true
+                  x-deprecation-reason: "Use the new queries-inspection workflow; this flag will be removed in a future release."

Linter output to address:

  • ERROR: src/libs/Cohere/openapi.yaml:13949:13 — Schema type mismatch: 'object' type should not contain 'items' field (#/components/schemas/EmbedByTypeResponse/properties/embeddings/items).
  • WARNINGS: multiple "Required property '... ' is undefined" at src/libs/Cohere/openapi.yaml lines 13572, 13573, 13574, 13575, 13943, 15255, 6343, 17502, 16611, 17209, 17211, etc.

Actions required:

  • Add the x-deprecation-reason line.
  • Fix the EmbedByTypeResponse schema error and define/restore any required properties referenced by the spec (or remove them from required).
  • Re-run: npx -y @redocly/cli@latest lint src/libs/Cohere/openapi.yaml and attach the updated output.
  • After the spec validates, confirm (or document) that deprecating search_queries_only is backward-compatible on the server side.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 168 to 174, add an
x-deprecation-reason one-line note for the search_queries_only field, then fix
the OpenAPI linter errors by correcting the EmbedByTypeResponse schema (remove
the items attribute from any property typed as "object" or change the property
type to "array" if it actually contains items) and resolve the multiple
"Required property '... ' is undefined" warnings by either defining the missing
properties under the appropriate schema or removing them from the required
arrays where they are not present; after making these changes re-run npx -y
@redocly/cli@latest lint src/libs/Cohere/openapi.yaml and attach the lint
output, and finally document or confirm that deprecating search_queries_only is
backward-compatible on the server side.

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

Final deprecation hunk: add rationale and lint.

Add the vendor reason here as well and re-run the linter to ensure no structural regressions.

       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Deprecated operation."

🏁 Script executed:

#!/bin/bash
npx -y @redocly/cli@latest lint src/libs/Cohere/openapi.yaml

Length of output: 8369


Final deprecation hunk: add rationale and fix linter errors.

  • Add the vendor deprecation reason next to deprecated: true and re-run the linter. Apply:
       '504':
         $ref: '#/components/responses/GatewayTimeout'
       deprecated: true
+      x-deprecation-reason: "Deprecated operation."
  • Linter currently fails: 1 error and 20 warnings. Fix the error at src/libs/Cohere/openapi.yaml:13949 (#/components/schemas/EmbedByTypeResponse/properties/embeddings/items) — schema uses type: object but contains items (change to type: array or remove items). Also address undefined required properties in CreateConnectorOAuth (lines ~13572–13575) and undefined api_version in embed responses (lines ~13943, 15255), then re-run:
npx -y @redocly/cli@latest lint src/libs/Cohere/openapi.yaml
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 7178-7184 (and also address related
issues at ~13572-13575, 13943, 13949, and 15255): add a vendor deprecation
reason next to any deprecated: true entries (x-vendor or vendorExtensions per
your spec/linter), fix the schema at
#/components/schemas/EmbedByTypeResponse/properties/embeddings/items (line
~13949) by changing type: object to type: array if items is required or remove
the items field and keep object, correct undefined required properties in
CreateConnectorOAuth (lines ~13572–13575) by either defining those properties in
the schema or removing them from required, and add the missing api_version
property in the embed response schemas (lines ~13943 and ~15255) with an
appropriate type; after making these changes re-run npx -y @redocly/cli@latest
lint src/libs/Cohere/openapi.yaml to confirm the linter is clean.

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