Repository navigation
refactor(apidoc): replace legacy viewer calls with dictionary lookup - #720
Open
yangjj-iso wants to merge 2 commits into
Open
yangjj-iso wants to merge 2 commits into
yangjj-iso wants to merge 2 commits into
Conversation
Merged
2 of 3 tasks
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open findings
What changed in this PR
Refactors the ApiDoc UI to stop calling legacy /apidoc/* endpoints for debug environments and instead load environments via the existing dictionary endpoint, while keeping the rest of the ApiDoc functionality intact.
Changes:
- Replaced legacy
getDocMenususage withfetchShenYuDictByType({ type: "apidocEnv" })and mapped enabled entries into the debug UI’s expectedenvPropsshape. - Removed obsolete request helpers (
getDocMenus,getDocItem) from the services layer. - Added Jest coverage ensuring enabled/disabled env filtering works and API detail/mock loading remains functional.
| File | Description |
|---|---|
| src/services/api.js | Removes legacy apidoc request helpers now replaced by dictionary lookup. |
| src/routes/Document/ApiDoc.js | Loads debug environments from dictionaries and maps them into envProps. |
| src/routes/Document/ApiDoc.test.js | Adds tests covering env filtering/mapping and ensuring API detail/mock still load. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot stopped reviewing on behalf of
dengliming due to an error
October 13, 2026 16:14
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Related to apache/shenyu#7592.
Companion backend removal and embedded dashboard update: apache/shenyu#7603
The API documentation page still calls
/apidoc/getDocMenusfor debug environments, although its API/tag tree already uses the database-backed/apiand/tagendpoints. Read environments from the existing/shenyu-dict/all/apidocEnvendpoint instead, preserving the enabled-entry filter and the field mapping expected by the debug UI. Remove the obsolete menu-tree transformation and the unusedgetDocMenus/getDocItemrequest helpers.Why the existing page and menu remain
The current
ApiDocpage hosts working API/tag management, API details, Swagger import, and request debugging.SearchApiloads its tree independently throughgetRootTag/getApi, and contains the Swagger import dialog. Deleting the page and menu as originally proposed in apache/shenyu#7592 would also remove those working features. This change removes the legacy endpoint dependency while preserving the existing page, menu, import entry point, and debug environments.The new dictionary endpoint already exists on the backend, so this frontend change can be deployed before removal of
ApiDocController.Validation
npm test -- src/routes/Document: 6 suites, 21 tests passed, including coverage for enabled/disabled environment entries, an empty environment list, and API-detail/mock loading.NODE_OPTIONS='--openssl-legacy-provider --max-old-space-size=6144' npm run build: passed.