mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6430] [MERGED] docs(api): mark collection responses nullable #6266
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#6266
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/6430
Author: @LineGM
Created: 9/7/2026
Status: ✅ Merged
Merged: 9/8/2026
Merged by: @MHSanaei
Base:
main← Head:docs/nullable-collection-responses📝 Commits (2)
8e3a788docs(api): mark collection responses nullable54278e3docs(api): include nullable Xray log responses📊 Changes
5 files changed (+46 additions, -5 deletions)
View changed files
📝
docs/public/openapi.json(+9 -1)📝
frontend/public/openapi.json(+9 -1)📝
frontend/scripts/build-openapi.mjs(+7 -1)📝
frontend/src/pages/api-docs/endpoints.ts(+4 -1)📝
frontend/src/test/openapi-runtime-contracts.test.ts(+17 -1)📄 Description
Summary
Document three existing nullable collection responses in OpenAPI:
GET /panel/api/inbounds/allLinks:string[] | null.POST /panel/api/server/logs/{count}:string[] | null.POST /panel/api/server/xraylogs/{count}:LogEntry[] | null.Add opt-in nullable support for generated response arrays, preserving the Xray log example generated from
LogEntry, and regression coverage for all three contracts.Runtime behavior remains unchanged.
Why
Related to #6411.
These endpoints can return a nil Go slice, which the panel envelope serializes as
"obj": null, including successful empty responses. OpenAPI previously left the allLinks response object unconstrained and described both log responses as non-nullable arrays. Explicit nullable array schemas let generated clients account for the existing wire format. Other generated array schemas retain their current nullability.Type of change
Areas affected
How was this tested?
Local toolchains: Node 24.20.0, Go 1.27.1, pnpm 11.25.0 (via Corepack).
cd frontend && npm test -- src/test/openapi-runtime-contracts.test.ts src/test/openapi-request-bodies.test.ts: 2 files / 7 tests passed. All three affected schema assertions were confirmed failing before their fixes; the Xray log test also verifies the generated example is preserved.cd frontend && npm run format:check && npm run lint && npm run typecheck: passed.make gen: passed; repeated generation produced an identical diff.cp frontend/public/openapi.json docs/public/openapi.jsonandcd docs && pnpm gen:api: completed. MDX regeneration produced no changes.cd docs && pnpm format:check && pnpm lint && pnpm typecheck && pnpm test: passed (12 test files, 106 tests).cmp frontend/public/openapi.json docs/public/openapi.jsonandgit diff --check: passed.Full
make verifyis left to GitHub Actions. The diff contains only API metadata, the OpenAPI generator, regression tests, and the two generated OpenAPI copies; no Go or frontend runtime changes.Breaking changes
None.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.