-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Set both /v1/serp/{path} operationIds to serp_v1_serp__path__post #602
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
Conversation
WalkthroughOperationId values for GET and POST at /v1/serp/{path} in src/libs/Jina/openapi.yaml were changed so both operations now share the identifier serp_v1_serp__path__post. No parameters, responses, or other fields were modified. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 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: 2
🧹 Nitpick comments (1)
src/libs/Jina/openapi.yaml (1)
1-361: Note: changing operationIds is a client-facing breaking change.If SDKs are generated from this spec, this rename affects method names. Consider documenting in release notes and bumping API version (info.version) accordingly.
Also applies to: 362-1417
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
src/libs/Jina/Generated/Jina.Models.SerpV1SerpPathPostResponse.Json.g.csis excluded by!**/generated/**src/libs/Jina/Generated/Jina.Models.SerpV1SerpPathPostResponse.g.csis excluded by!**/generated/**src/libs/Jina/Generated/Jina.Models.SerpV1SerpPathPostResponse2.Json.g.csis excluded by!**/generated/**src/libs/Jina/Generated/Jina.Models.SerpV1SerpPathPostResponse2.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/Jina/openapi.yaml(2 hunks)
| - serp | ||
| summary: Serp | ||
| operationId: serp_v1_serp__path__get | ||
| operationId: serp_v1_serp__path__post |
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.
Duplicate and incorrect operationId for GET /v1/serp/{path}.
GET and POST share the same operationId, which breaks many generators and SDKs. The GET should end with _get, not _post.
Apply this fix:
- operationId: serp_v1_serp__path__post
+ operationId: serp_v1_serp__path__get📝 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.
| operationId: serp_v1_serp__path__post | |
| operationId: serp_v1_serp__path__get |
🤖 Prompt for AI Agents
In src/libs/Jina/openapi.yaml around line 306, the operationId for the GET
/v1/serp/{path} endpoint is incorrectly set to "serp_v1_serp__path__post"
(duplicating the POST operationId); change it to a unique value ending with
"_get" (for example "serp_v1_serp__path__get") so GET and POST have distinct
operationIds, update any references if present to the new operationId, and
ensure there are no other duplicate operationId values in the file.
| - serp | ||
| summary: Serp | ||
| operationId: serp_v1_serp__path__get | ||
| operationId: serp_v1_serp__path__post |
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.
💡 Verification agent
🧩 Analysis chain
Ensure operationId uniqueness across the spec and method-suffix consistency.
POST’s operationId looks fine; after fixing GET, confirm no other duplicates and that each operationId ends with its HTTP method suffix.
Run this script to verify:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
pip -q install pyyaml >/dev/null
python - <<'PY'
import sys, yaml, re
p = 'src/libs/Jina/openapi.yaml'
doc = yaml.safe_load(open(p))
ops = {}
dups = {}
bad_suffix = []
for path, methods in doc.get('paths', {}).items():
for m, op in methods.items():
if m.lower() not in {'get','post','put','patch','delete','head','options','trace'}:
continue
oid = op.get('operationId')
if not oid:
print(f"Missing operationId: {m.upper()} {path}")
continue
ops.setdefault(oid, []).append((m.upper(), path))
# method suffix check (allow anything but recommend)
if not oid.endswith(f"_{m.lower()}"):
bad_suffix.append((oid, m.upper(), path))
for oid, lst in ops.items():
if len(lst) > 1:
dups[oid] = lst
if dups:
print("Duplicate operationIds detected:")
for oid, lst in dups.items():
print(f" {oid}: " + ", ".join(f"{m} {pa}" for m,pa in lst))
sys.exit(1)
if bad_suffix:
print("OperationId method-suffix inconsistencies:")
for oid, m, pa in bad_suffix:
print(f" {oid} -> {m} {pa}")
# non-fatal; exit 0 to allow discussion
else:
print("No duplicates; suffixes consistent.")
PYLength of output: 102
Fix duplicate operationId: serp_v1_serp__path__post
GET /v1/serp/{path} and POST /v1/serp/{path} in src/libs/Jina/openapi.yaml both declare operationId serp_v1_serp__path__post — rename the GET operationId to end with _get (e.g. serp_v1_serp__path__get) or another unique name, then verify all operationIds are unique and end with the HTTP-method suffix.
🤖 Prompt for AI Agents
In src/libs/Jina/openapi.yaml around line 330, the operationId for the GET
/v1/serp/{path} is duplicated with the POST's operationId
`serp_v1_serp__path__post`; change the GET operationId to a unique name ending
with `_get` (e.g. `serp_v1_serp__path__get`) and update any references that rely
on that operationId; then scan the file to ensure every operationId is unique
and follows the HTTP-method suffix convention.
Summary by CodeRabbit
Documentation
Chores