mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #4312] [MERGED] feat(api-docs): enhance API documentation with missing endpoints, search, collapse, syntax highlighting, body examples, error responses, and route sync test #5650
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5650
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/4312
Author: @abdalrahmanx9
Created: 5/12/2026
Status: ✅ Merged
Merged: 5/12/2026
Merged by: @MHSanaei
Base:
main← Head:feat/api-docs-enhancements📝 Commits (6)
a141b4ffeat(api-docs): enhance API documentation with missing endpoints, search, collapse, and route sync test14604e0feat(api-docs): add JSON syntax highlighting and top-right copy button to code blocks2aeaaa9fix(api-docs): use distinct colors for JSON syntax highlighting (green strings, amber numbers)8e30a23feat(api-docs): add request body examples, error responses, WebSocket message types, and subscription response headers34ea51ffix(api-docs): use ClipboardManager.copyText instead of copy to fix API token copy button26246eefix📊 Changes
6 files changed (+859 additions, -28 deletions)
View changed files
📝
frontend/src/pages/api-docs/ApiDocsPage.vue(+104 -5)➕
frontend/src/pages/api-docs/CodeBlock.vue(+152 -0)📝
frontend/src/pages/api-docs/EndpointRow.vue(+18 -8)📝
frontend/src/pages/api-docs/EndpointSection.vue(+98 -7)📝
frontend/src/pages/api-docs/endpoints.js(+327 -8)➕
web/controller/api_docs_test.go(+160 -0)📄 Description
Summary
Enhance the in-panel API documentation page (
/panel/api-docs) with complete endpoint coverage, visual improvements, request/response examples, and a CI test to keep docs in sync.Changes
Complete endpoint coverage (29 previously undocumented routes added):
xrayMetricsState,xrayMetricsHistory,xrayObservatory,xrayObservatoryHistory/panel/setting/*routes/panel/xray/*routes/sub/:subid,/json/:subid,/clash/:subid/wsendpoint with 4 message type descriptionsAccuracy fixes:
netUp/netDownnotnetIn/netOut, addedload5/load15, node metrics limited tocpu/mem)getNewVlessEncdescription to reflect actual response shapeRequest body examples: Added to 6 previously undocumented POST endpoints (
updateGeofile,xraylogs,importDB,getNewEchCert, nodeupdate/:id, nodetest)Response schemas: Added example responses to 15+ key endpoints (inbound list, server status, traffic, logs, cert generators, etc.)
Error response examples: Added error shapes to key endpoints (login, inbound add, server stop/restart)
HTTP status codes: Documented in the page header (
200,401,403,404,500)Subscription headers table: Added 8 response headers with descriptions (
Subscription-Userinfo,Profile-Title,Support-Url, etc.)UI improvements:
CI / maintainability:
TestAPIRoutesDocumentedGo test scans all controller files for route registrations and verifies every route is documented inendpoints.js— run withgo test -run TestAPIRoutesDocumented🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.