-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Deprecate ops and 504/ServiceUnavailable in Cohere openapi.yaml #276
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
WalkthroughOpenAPI spec at src/libs/Cohere/openapi.yaml was updated to mark specific operations and several 504/ServiceUnavailable response mappings as deprecated. Flags were added to the ChatConnector web-search operation, the search_queries_only operation, and multiple GatewayTimeout-related responses. No runtime code or logic changes are included. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ 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: 1
🧹 Nitpick comments (10)
src/libs/Cohere/openapi.yaml (10)
168-174: Property deprecation: add migration guidance and sunset metadata.
search_queries_onlyis now deprecated. Add a short note pointing to the replacement flag/flow, and consider anx-sunsetorx-deprecationextension with a date and link to migration docs to aid SDK consumers. (redocly.com)
1004-1010: Operation deprecation: ensure placement is at Operation level.
deprecated: truemust be a sibling ofresponseson the Operation Object, not within a Response. Please verify indentation so linters treat it as the operation’s flag. Also add a brief deprecation reason/alternative in the operation description. (redocly.com)
1128-1134: Same as above: verifydeprecatedis on the Operation, not the Response block.Keep indentation consistent and consider adding a short “Use X instead” note in
description. (redocly.com)
1198-1204: Confirm op-level deprecation and add rationale.Lint placement and add guidance to reduce client confusion. (redocly.com)
1271-1277: Repeat check: op-leveldeprecatedplacement.As above; verify indentation and add a migration hint in
description. (redocly.com)
1343-1349: Repeat check across endpoints.Ensure lint-valid placement and add a deprecation note for consumers. (redocly.com)
1421-1427: Repeat check across endpoints.Confirm op-level placement; add a short “replacement API” pointer. (redocly.com)
1501-1507: Repeat check across endpoints.Same validation and doc guidance as previous hunks. (redocly.com)
6623-6629: Repeat check across endpoints.Operation-level
deprecatedplacement + add rationale. (redocly.com)
7178-7184: Repeat check across endpoints.Operation-level
deprecatedplacement + brief alternative. (redocly.com)
📜 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(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
| 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: |
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.
🛠️ Refactor suggestion
🧩 Analysis chain
Deprecation on $ref’d items: confirm OAS 3.1 or wrap with allOf.
You’re adding deprecated: true alongside a $ref under a Schema items. This is valid only if the spec is OpenAPI 3.1 (schema $ref can have siblings). If the file is still OpenAPI 3.0.x, siblings to $ref in Schema Objects are not allowed and many tools will ignore them. Either upgrade to 3.1 or wrap with allOf. Also, deprecating the items schema deprecates the entire ChatConnector item type—verify that’s the intent (vs. deprecating only the "web-search" connector id). (github.com)
Apply if staying on OAS 3.0.x:
- 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
+ items:
+ allOf:
+ - $ref: '#/components/schemas/ChatConnector'
+ - deprecated: true
+ description: "Accepts `{\"id\": \"web-search\"}` ... (context unchanged)"Quick check script:
🏁 Script executed:
#!/bin/bash
# Show declared OpenAPI version and highlight $ref siblings under items
head -n 5 src/libs/Cohere/openapi.yaml | rg -n '^openapi:'
rg -nA3 -B2 $'items:\\s*$' src/libs/Cohere/openapi.yaml | rg -nA3 -B0 '\\$ref|deprecated|description'Length of output: 16938
Deprecation on $ref’d items: file declares OpenAPI 3.0.4 — wrap with allOf or upgrade to 3.1.
openapi: 3.0.4 and the items block in src/libs/Cohere/openapi.yaml contains a $ref plus description and deprecated: true — OAS 3.0.x forbids siblings to $ref. Either upgrade to 3.1 or wrap the $ref in allOf. Also confirm you intend to deprecate the entire ChatConnector schema (not only the "web-search" connector id).
Apply if staying on OAS 3.0.x:
- 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
+ items:
+ allOf:
+ - $ref: '#/components/schemas/ChatConnector'
+ - deprecated: true
+ description: "Accepts `{\"id\": \"web-search\"}` ... (context unchanged)"📝 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.
| 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' | |
| - deprecated: true | |
| 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" |
Summary by CodeRabbit