-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Deprecate OpenAPI params and responses; clarify image_url; add curl #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdded 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests
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. Comment |
There was a problem hiding this 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: trueunderitems:deprecates the item schema, not the request parameter itself. If the intent is to deprecate the whole parameter (the connectors array), placedeprecated: trueon the Parameter Object (same level asname,in,schema,description). Otherwise this may have no effect in generated SDKs/docs.Apply within this hunk (remove the misplaced flag):
- deprecated: trueThen 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
⛔ Files ignored due to path filters (21)
src/libs/Cohere/Generated/Cohere.CohereClient.Chat.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.CohereClient.Classify.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.CohereClient.Generate.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.CohereClient.Summarize.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.CreateConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.DeleteConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.GetConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.ListConnectors.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.OAuthAuthorizeConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ConnectorsClient.UpdateConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Chat.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Classify.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Generate.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.ICohereClient.Summarize.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.CreateConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.DeleteConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.GetConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.ListConnectors.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.OAuthAuthorizeConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.IConnectorsClient.UpdateConnector.g.csis excluded by!**/generated/**src/libs/Cohere/Generated/Cohere.Models.ChatRequest.g.csis 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_onlyusesdeprecated: trueon 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: trueLikely an incorrect or invalid review comment.
6623-6629: Remove unintended operation deprecation.- deprecated: trueLikely an incorrect or invalid review comment.
1501-1507: Remove unintended operation deprecation.- deprecated: trueLikely an incorrect or invalid review comment.
1343-1349: Remove unintended operation deprecation.- deprecated: trueLikely an incorrect or invalid review comment.
| $ref: '#/components/responses/ServiceUnavailable' | ||
| '504': | ||
| $ref: '#/components/responses/GatewayTimeout' | ||
| deprecated: true | ||
| x-fern-audiences: | ||
| - public | ||
| x-fern-examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: trueThen, 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.
| $ref: '#/components/responses/ServiceUnavailable' | ||
| '504': | ||
| $ref: '#/components/responses/GatewayTimeout' | ||
| deprecated: true | ||
| x-fern-audiences: | ||
| - public | ||
| x-fern-examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: trueCommittable 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.
| $ref: '#/components/responses/ServiceUnavailable' | ||
| '504': | ||
| $ref: '#/components/responses/GatewayTimeout' | ||
| deprecated: true | ||
| x-fern-audiences: | ||
| - public | ||
| x-fern-examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unintended operation deprecation.
- deprecated: trueCommittable 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.
| $ref: '#/components/responses/ServiceUnavailable' | ||
| '504': | ||
| $ref: '#/components/responses/GatewayTimeout' | ||
| deprecated: true | ||
| x-fern-audiences: | ||
| - public | ||
| x-fern-examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unintended operation deprecation.
- deprecated: trueCommittable 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.
| $ref: '#/components/responses/ServiceUnavailable' | ||
| '504': | ||
| $ref: '#/components/responses/GatewayTimeout' | ||
| deprecated: true | ||
| x-fern-audiences: | ||
| - public | ||
| x-fern-examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unintended operation deprecation.
- deprecated: trueCommittable 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.
Summary by CodeRabbit