api: return helpful error when calling a function with too-old an API…#7833
api: return helpful error when calling a function with too-old an API…#7833Abhishek01samal wants to merge 2 commits into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Review Summary by QodoReturn helpful error for API functions with too-old version
WalkthroughsDescription• Detects when API function exists but unavailable in requested version • Returns helpful error message with minimum supported API version • Implements version comparison logic for both legacy and OpenAPI routing • Adds regression test for version mismatch handling Diagramflowchart LR
A["API Request<br/>with old version"] --> B["Check function<br/>in version"]
B --> C["Function not found<br/>in version"]
C --> D["Search all versions<br/>for function"]
D --> E["Found in newer<br/>version"]
E --> F["Return helpful error<br/>with min version"]
D --> G["Not found anywhere"]
G --> H["Return generic error"]
File Changes1. src/node/handler/APIHandler.ts
|
Code Review by Qodo
1.
|
|
Why is copyPad moved from 1.2.8 to 1.2.7? Please check your commits before sending PRs or at least check your work after PR :) cc @SamTV12345 - be careful w/ quality of contributions from Op |
Summary
Improves the error message returned when an API function exists but is unavailable in the requested API version.
Previously, requests such as
/api/1/copyPadreturned a generic"no such function"error even though the function exists in newer API versions.This change detects that case and returns a more helpful message indicating the minimum supported API version.
Fixes #6849
Testing