-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Mark deprecated parameters and operations in Cohere OpenAPI spec #259
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
WalkthroughDeprecation metadata was added in src/libs/Cohere/openapi.yaml: two parameters were marked deprecated and several operations were marked deprecated. No schema or response shape changes were introduced. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
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: 1
🧹 Nitpick comments (7)
src/libs/Cohere/openapi.yaml (7)
63-69: Schema-level deprecation is valid; add rationale and replacement.Marking this property deprecated is fine. Add an explicit deprecation note and replacement pointer so SDK docs and portal show actionable guidance, and optionally a sunset date via a vendor extension.
Apply near this node:
description: "Accepts {\"id\": \"web-search\"} ..." deprecated: true + x-deprecation-reason: "Replaced by 'tools' array with 'web-search' tool configuration." + x-sunset: "2025-12-31"
1007-1010: Operation deprecated; include migration breadcrumb.Add an explicit “use X instead” to the operation description or via an extension so client portals render migration paths.
deprecated: true + x-deprecation-replaced-by: "/v2/messages.create"
1201-1204: Consider adding a planned removal date.Helps downstreams plan. Keep dates in UTC ISO-8601.
deprecated: true + x-sunset: "2026-03-31"
1274-1277: Deprecation without tags can bury the endpoint.If not already present elsewhere, add a short sentence in the operation description pointing to the successor.
1424-1427: If 504 is the only differentiator, consider removing it when deprecated.Not blocking, but trimming responses on deprecated ops can reduce support surface.
1504-1507: Documentation nudge.Add a single, consistent deprecation paragraph template to keep portal text uniform.
7181-7184: Final pass LGTM with minor polish.Changes are correct; add replacement/sunset metadata when available.
📜 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 (3)
src/libs/Cohere/openapi.yaml (3)
6626-6629: Verify deprecated operations don't require parametersAutomated check returned no matches; confirm src/libs/Cohere/openapi.yaml contains no operations with "deprecated: true" that still define parameters with "required: true". Run locally:
python - <<'PY' import yaml o = yaml.safe_load(open('src/libs/Cohere/openapi.yaml')) for path, methods in o.get('paths', {}).items(): for method, op in (methods or {}).items(): if isinstance(op, dict) and op.get('deprecated') is True: for p in op.get('parameters', []): if p.get('required') is True: print(path, method, p.get('name')) PYIf any are found, mark the parameter schema deprecated or remove/set required: false.
1346-1349: Check SDK generation impact — deprecated ops present in OpenAPIsrc/libs/Cohere/openapi.yaml marks these operationIds as deprecated: chat, classify, list-connectors, create-connector, delete-connector, get-connector, update-connector, oAuthAuthorize-connector, generate, summarize. A ripgrep run skipped files and returned no matches, so usages could not be confirmed. Confirm SDK generation and tests: ensure SDKs still compile and no tests/imports reference these operations; if your generator hides deprecated ops by default, regenerate SDKs or update code/tests accordingly.
168-174: ```shell
#!/bin/bash
set -euo pipefailecho "PWD: $(pwd)"
echo "Top-level files:"
ls -la || trueecho
echo "Is this a git repo?"
git rev-parse --is-inside-work-tree 2>/dev/null || echo "Not a git repo"echo
echo "Sample file list (up to 200 entries):"
find . -maxdepth 3 -type f | sed -n '1,200p' || trueecho
echo "Running ripgrep (debug) to find occurrences of possible deprecated flags/keys..."
rg --debug -n --no-heading -C1 -uu --hidden -S -g '!.git'
-e '\bsearch_queries_only\b'
-e '"search_queries_only"\s*:'
-e '\bsearch-queries\b'
-e '\bsearch-queries-only\b'
-e '"search-queries"\s*'
-e '"search-queries-only"\s*' || echo "rg finished (no matches or non-zero exit)."</blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
| 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.
🧩 Analysis chain
Repeat deprecation metadata pattern consistently.
Ensure each deprecated operation declares a replacement (or “none”) to avoid ambiguous docs.
🏁 Script executed:
#!/bin/bash
rg -nP -C2 'deprecated:\s*true' src/libs/Cohere/openapi.yaml | rg -nC0 -v 'x-deprecation-replaced-by'Length of output: 3617
Add x-deprecation-replaced-by to all deprecated operations (or set to "none")
14 deprecated entries in src/libs/Cohere/openapi.yaml are missing x-deprecation-replaced-by; add the replacement key (or "none") for each to avoid ambiguous docs.
Locations: src/libs/Cohere/openapi.yaml — lines 66, 171, 862, 919, 959, 1007, 1131, 1201, 1274, 1346, 1424, 1504, 6626, 7181
🤖 Prompt for AI Agents
In src/libs/Cohere/openapi.yaml around lines 1131 to 1134 (and for the other
deprecated entries at lines 66, 171, 862, 919, 959, 1007, 1201, 1274, 1346,
1424, 1504, 6626, 7181), add the OpenAPI extension x-deprecation-replaced-by for
each operation that is marked deprecated (or explicitly set it to "none"); place
the x-deprecation-replaced-by key at the same level as deprecated: true, using
the replacement operationId or path as the value (or the string "none" if there
is no replacement), and ensure proper YAML indentation and validity so the
extension is recognized by the spec.
Summary by CodeRabbit
Documentation
Chores