LCORE-1561: fix InvalidClusterVersionError message in OpenAPI documentation#1390
Conversation
…tation - Updated OpenAPI example to match actual `InvalidClusterVersionError` message raised at runtime - Fixed inconsistency between documented and actual error messages for invalid ClusterVersion validation
WalkthroughUpdated OpenAPI documentation operationIds for A2A endpoints and harmonized error message examples for invalid cluster version errors across API documentation, response models, and test assertions. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
| "summary": "Handle A2A Jsonrpc", | ||
| "description": "Handle A2A JSON-RPC requests following the A2A protocol specification.\n\nThis endpoint uses the DefaultRequestHandler from the A2A SDK to handle\nall JSON-RPC requests including message/send, message/stream, etc.\n\nThe A2A SDK application is created per-request to include authentication\ncontext while still leveraging FastAPI's authorization middleware.\n\nAutomatically detects streaming requests (message/stream JSON-RPC method)\nand returns a StreamingResponse to enable real-time chunk delivery.\n\nArgs:\n request: FastAPI request object\n auth: Authentication tuple\n mcp_headers: MCP headers for context propagation\n\nReturns:\n JSON-RPC response or streaming response", | ||
| "operationId": "handle_a2a_jsonrpc_a2a_post", | ||
| "operationId": "handle_a2a_jsonrpc_a2a_get", |
There was a problem hiding this comment.
ps: I haven't changed anything related to this in this PR, but the schema generation re-generated this doc and this part got bubbled up too. I guess it was pending.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/openapi.json (1)
5366-5384:⚠️ Potential issue | 🟠 MajorUse distinct operationIds for GET and POST
/a2a.Both the GET and POST methods on
/a2ahave the same operationId (handle_a2a_jsonrpc_a2a_get), which violates OpenAPI uniqueness requirements and will break client generation and operation-based routing.♻️ Proposed fix
- "operationId": "handle_a2a_jsonrpc_a2a_get", + "operationId": "handle_a2a_jsonrpc_a2a_post",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/openapi.json` around lines 5366 - 5384, The OpenAPI spec defines the same operationId "handle_a2a_jsonrpc_a2a_get" for both GET and POST on /a2a which must be unique; update the POST operationId to a distinct identifier (for example "handle_a2a_jsonrpc_a2a_post") wherever it's declared in the document so the POST operation uses that new name, ensuring the GET keeps "handle_a2a_jsonrpc_a2a_get" and that any references/callers that rely on the POST operationId are updated to the new identifier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@docs/openapi.json`:
- Around line 5366-5384: The OpenAPI spec defines the same operationId
"handle_a2a_jsonrpc_a2a_get" for both GET and POST on /a2a which must be unique;
update the POST operationId to a distinct identifier (for example
"handle_a2a_jsonrpc_a2a_post") wherever it's declared in the document so the
POST operation uses that new name, ensuring the GET keeps
"handle_a2a_jsonrpc_a2a_get" and that any references/callers that rely on the
POST operationId are updated to the new identifier.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dd220f27-46f4-4ad9-8c2e-338b16fade51
📒 Files selected for processing (3)
docs/openapi.jsonsrc/models/responses.pytests/unit/authentication/test_k8s.py
Description
InvalidClusterVersionErrormessage raised at runtimeType of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
Summary by CodeRabbit
Bug Fixes
Documentation