Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 21, 2025

Summary by CodeRabbit

  • Documentation
    • Marked select API endpoints, parameters, and response codes as deprecated in the public API reference.
    • Clarified Images SDK examples to accept image_url as either a base64 data URI or a web URL, with updated inline comments across languages.
    • Added a new curl example for Images usage.

@coderabbitai
Copy link

coderabbitai bot commented Sep 21, 2025

Walkthrough

Added deprecation flags to numerous OpenAPI path parameters and response entries, including 5xx responses and certain request parameters. Updated Images SDK code samples to clarify image_url may be a base64 data URI or a web URL, and added a new curl example. All edits occur within src/libs/Cohere/openapi.yaml.

Changes

Cohort / File(s) Summary
OpenAPI deprecations
src/libs/Cohere/openapi.yaml
Added deprecated: true to multiple path-level parameters (e.g., web-search, search_queries_only) and to various response schemas (e.g., 503 ServiceUnavailable, 504 GatewayTimeout) across several endpoints. Some path/component sections marked deprecated at higher scope.
Images SDK examples
src/libs/Cohere/openapi.yaml
Updated Node, Python, Java, and Go code samples to note image_url accepts base64 data URIs or web URLs; added a new curl example block under Images examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through specs with gentle care,
Tagging deprecations everywhere—
A curl now joins the sample show,
And images find two ways to flow.
Ears perked high, I stamp and sign:
“This YAML’s marked—retire on time.” 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "feat:@coderabbitai" is vague and does not summarize the pull request's main changes; the changeset appears to primarily add deprecation markers across the OpenAPI specification and update Images SDK examples, which the title does not convey. Please replace the title with a short, descriptive summary such as "chore(openapi): mark multiple endpoints deprecated and update Images SDK examples" or "docs: deprecate OpenAPI paths and add Images example curl sample" so reviewers can immediately understand the primary intent.
✅ 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_202509210338

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 21, 2025 03:38
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Deprecate OpenAPI params and responses; clarify image_url; add curl Sep 21, 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: 5

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

63-69: Likely misplaced deprecation flag on array items (doesn’t deprecate the parameter).

deprecated: true under items: deprecates the item schema, not the request parameter itself. If the intent is to deprecate the whole parameter (the connectors array), place deprecated: true on the Parameter Object (same level as name, in, schema, description). Otherwise this may have no effect in generated SDKs/docs.

Apply within this hunk (remove the misplaced flag):

-                  deprecated: true

Then add at the parameter level outside this hunk (example):

parameters:
  - name: connectors
    in: body
    description: ...
    deprecated: true
    schema:
      type: array
      items:
        $ref: '#/components/schemas/ChatConnector'

8775-8787: Examples: minor consistency and header auth polish.

  • Use consistent model across language examples (e.g., all command-a-vision-07-2025), unless the Go example intentionally targets a different model/version.
  • In curl, prefer Authorization: Bearer $CO_API_KEY (capital “B”) for standard bearer scheme formatting.
  • Node example: instantiate client with an explicit token source to reduce copy‑paste failures.

Targeted diffs within this hunk:

-  --header "Authorization: bearer $CO_API_KEY" \
+  --header "Authorization: Bearer $CO_API_KEY" \
-  const cohere = new CohereClientV2({});
+  const cohere = new CohereClientV2({ token: process.env.COHERE_API_KEY });
-    model: 'command-a-vision-07-2025',
+    model: 'command-a-vision-07-2025',

And align Go example model (if not intentional):

-            Model: "command-a-03-2025",
+            Model: "command-a-vision-07-2025",
📜 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 aa37d81.

⛔ 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 (12 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 (5)
src/libs/Cohere/openapi.yaml (5)

168-174: Parameter-level deprecation is correctly placed.

search_queries_only uses deprecated: true on the Parameter Object, which is supported and should propagate to SDKs/docs.

Confirm downstream code/examples don’t still advertise or rely on this parameter.


7178-7184: Remove unintended operation deprecation.

-      deprecated: true

Likely an incorrect or invalid review comment.


6623-6629: Remove unintended operation deprecation.

-      deprecated: true

Likely an incorrect or invalid review comment.


1501-1507: Remove unintended operation deprecation.

-      deprecated: true

Likely an incorrect or invalid review comment.


1343-1349: Remove unintended operation deprecation.

-      deprecated: true

Likely an incorrect or invalid review comment.

Comment on lines 1004 to 1010
$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

This deprecates the entire operation, not just 5xx responses.

Placing deprecated: true at the operation level will mark the WHOLE endpoint as deprecated in generators and docs. OpenAPI does not support deprecating individual Response Objects with a top‑level deprecated. If your intent was to discourage reliance on 503/504, use a vendor extension on the referenced response component (e.g., x-deprecated: true) and/or clarify in the response description.

Apply within this hunk (remove the unintended operation deprecation):

-      deprecated: true

Then, in components/responses/GatewayTimeout and ServiceUnavailable (outside this hunk), add a vendor extension and note:

components:
  responses:
    GatewayTimeout:
      description: Gateway Timeout. x-deprecated: true — do not rely on this for control flow.
      x-deprecated: true
      content: { ... }
    ServiceUnavailable:
      description: Service Unavailable. x-deprecated: true — do not rely on this for control flow.
      x-deprecated: true
      content: { ... }
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 1004 to 1010, remove the top-level
"deprecated: true" from the operation (this is deprecating the whole endpoint
unintentionally). Instead, update the components section (outside this hunk) for
responses GatewayTimeout and ServiceUnavailable: add a vendor extension
"x-deprecated: true" and prepend/append the response description with a short
note like "x-deprecated: true — do not rely on this for control flow." so
generators/docs will not mark the entire operation as deprecated but will mark
those specific response components as discouraged.

Comment on lines 1128 to 1134
$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

Same issue: whole operation marked deprecated.

Replicate the fix: remove deprecated: true at the operation level; move deprecation intent to the response components via x-deprecated: true and description.

-      deprecated: true

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

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 1128 to 1134 the entire operation
is marked deprecated; remove the operation-level deprecated: true field and
instead annotate the specific deprecated response schemas under
components/responses (or the relevant response object) by adding x-deprecated:
true and updating their description to note deprecation and recommended
alternative; ensure the operation remains available without deprecated: true
while each affected response component includes x-deprecated: true and a
descriptive deprecation note.

Comment on lines 1198 to 1204
$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

Remove unintended operation deprecation.

-      deprecated: true

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

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 1198 to 1204, an operation is
incorrectly marked as deprecated; remove the unintended deprecation by deleting
the deprecated: true entry (or setting deprecated: false) from that operation
object, ensure surrounding indentation and YAML structure remain valid, and run
the OpenAPI validator/linter to confirm there are no schema or reference errors
after the change.

Comment on lines 1271 to 1277
$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

Remove unintended operation deprecation.

-      deprecated: true

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

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 1271 to 1277 there is an unintended
deprecation marker on an operation; remove the "deprecated: true" (or the
deprecation entry) from that operation's definition so the operation is no
longer marked deprecated, and ensure the operation's description/metadata remain
intact and the YAML indentation and schema validity are preserved after removal.

Comment on lines 1421 to 1427
$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

Remove unintended operation deprecation.

-      deprecated: true

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

🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 1421 to 1427 there is an unintended
"deprecated" marker on an operation; remove the deprecated: true field (or the
deprecation sentence in the operation's description) from that operation object
so the operation is no longer marked deprecated, and if your project
auto-generates clients or docs, re-run the generator to propagate the change.

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