-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add deprecation flags to selected OpenAPI operations and a parameter #268
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
WalkthroughAdds deprecated: true flags to selected operations and a parameter in src/libs/Cohere/openapi.yaml, including a ChatConnector/web-search-related declaration and several path blocks after 504 GatewayTimeout responses. No schema, type, or behavior changes; only OpenAPI deprecation metadata updated. Changes
Sequence Diagram(s)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
Warning Tools execution failed with the following error: Failed to run tools: Ping-pong health check failed 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 (5)
src/libs/Cohere/openapi.yaml (5)
168-174: Deprecation OK; prefer machine-readable default.Marking this boolean as deprecated is fine. Consider adding
default: falseinstead of relying on description text for defaults, and briefly point to the replacement field/flow in the description.
1271-1277: Consistent deprecation marker.All good; consider adding a sunset/EOL date in operation
descriptionor via a customx-sunsetextension for consumers.
1343-1349: LGTM; keep docs in sync.If public docs are generated from this spec, add a short deprecation note guiding users to the replacement endpoint.
1421-1427: LGTM; minor doc hint.Add a one-line “Use X instead” to ease migrations.
7178-7184: LGTM; consider adding deprecation rationale.Brief rationale helps downstream SDK users when reading generated docs.
📜 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
🔇 Additional comments (5)
src/libs/Cohere/openapi.yaml (5)
1004-1010: Operation-level deprecation looks correct; verify indentation is at the Operation level.
deprecated: trueshould be a sibling ofresponses, not nested under it. The current placement appears correct; just ensure YAML indentation matches other operation-level fields.
1128-1134: Same as above: confirm operation-level indentation.Looks good; verify via a linter that
deprecatedis not underresponses.
1198-1204: Operation deprecation acknowledged.No schema/type impact. Ensure SDK regen flags these as deprecated.
1501-1507: LGTM; batch deprecations consistent.No further issues.
6623-6629: LGTM; validate entire spec after changes.After mass-editing, run validation to catch any accidental indentation or structural errors (example script provided in first comment).
| 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.
Fix invalid Schema usage: $ref with sibling keys under items.
items contains $ref alongside description and deprecated. In OAS 3.0.x this is invalid (tools will reject siblings of $ref). Use allOf to extend the referenced schema, or move deprecated to the parameter/schema definition being referenced.
Apply this pattern:
- items:
- $ref: '#/components/schemas/ChatConnector'
- description: "Accepts {\"id\": \"web-search\"} ... "
- deprecated: true
+ items:
+ allOf:
+ - $ref: '#/components/schemas/ChatConnector'
+ - description: "Accepts {\"id\": \"web-search\"} ... "
+ deprecated: trueOptional: If the intent is to deprecate the entire parameter (not just item schema), mark the parameter object itself as deprecated: true and keep items as a pure $ref.
Run an OpenAPI validation to catch $ref-sibling issues:
#!/bin/bash
# Validate spec with Swagger online validator
curl -s -X POST -H 'Content-Type: application/yaml' --data-binary @src/libs/Cohere/openapi.yaml https://validator.swagger.io/validator/debug | jq🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 63 to 69, the OpenAPI uses items
with a $ref plus sibling keys (description and deprecated) which is invalid in
OAS 3.0.x; replace the sibling usage by either (A) using allOf under items to
reference the schema and add description/deprecated (i.e., items: allOf: - $ref:
... - type/object with description/deprecated), or (B) move deprecated to the
parameter/schema object itself and keep items as a pure $ref; after making the
change run an OpenAPI validation (e.g., curl to
https://validator.swagger.io/validator/debug) to confirm no $ref-sibling errors
remain.
Summary by CodeRabbit