[PR #6296] [MERGED] fix(api-docs): generate request bodies for all encodings #6213

Closed
opened 2026-11-02 04:07:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6296
Author: @rokokol
Created: 8/24/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @MHSanaei

Base: main ← Head: fix/openapi-request-bodies


📝 Commits (4)

  • 0c752d2 fix(api-docs): generate request bodies for all encodings
  • 4f21391 fix(api-docs): align alternative request schemas
  • e4b599c Merge branch 'main' into fix/openapi-request-bodies
  • 3cb89fc fix(api-docs): send object urlencoded fields as JSON, document the inbound update body

📊 Changes

7 files changed (+2406 additions, -276 deletions)

View changed files

📝 docs/content/docs/en/reference/api/server.mdx (+6 -6)
📝 docs/content/docs/en/reference/api/subscription-balancers.mdx (+6 -6)
📝 docs/public/openapi.json (+937 -65)
📝 frontend/public/openapi.json (+937 -65)
📝 frontend/scripts/build-openapi.mjs (+109 -27)
📝 frontend/src/pages/api-docs/endpoints.ts (+271 -107)
➕ frontend/src/test/openapi-request-bodies.test.ts (+140 -0)

📄 Description

Summary

  • Generate request-body schemas for JSON, URL-encoded form, and multipart endpoint parameters instead of silently dropping non-generic body locations
  • Preserve required fields, optional fields, defaults, conditional alternatives, binary uploads, top-level arrays, and repeated form-array encoding
  • Correct request metadata that the complete schemas exposed, including server logs, node IP sync, update endpoints, outbound subscriptions, and subscription balancers
  • Regenerate and synchronize the panel and documentation OpenAPI specifications

Testing

  • npm run test
  • npm run typecheck
  • npm run lint
  • npm run format:check
  • npm run build
  • pnpm test
  • pnpm typecheck
  • pnpm lint
  • pnpm format:check
  • pnpm build
  • Verified Swagger serialization of repeated inboundIds form keys
  • Generated TypeScript definitions with openapi-typescript
  • Verified both committed OpenAPI specifications are byte-identical

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6296 **Author:** [@rokokol](https://github.com/rokokol) **Created:** 8/24/2026 **Status:** ✅ Merged **Merged:** 9/3/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/openapi-request-bodies` --- ### 📝 Commits (4) - [`0c752d2`](https://github.com/MHSanaei/3x-ui/commit/0c752d2a200b17f5dbf73158edb3c74d7668699b) fix(api-docs): generate request bodies for all encodings - [`4f21391`](https://github.com/MHSanaei/3x-ui/commit/4f21391f56b0f8915f8a91f84fe216df72edc4cd) fix(api-docs): align alternative request schemas - [`e4b599c`](https://github.com/MHSanaei/3x-ui/commit/e4b599c1dd2a70929e6019335b2d0627490e8c3b) Merge branch 'main' into fix/openapi-request-bodies - [`3cb89fc`](https://github.com/MHSanaei/3x-ui/commit/3cb89fc0f6ac3742732532df3accb99d0cd3bf7d) fix(api-docs): send object urlencoded fields as JSON, document the inbound update body ### 📊 Changes **7 files changed** (+2406 additions, -276 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/en/reference/api/server.mdx` (+6 -6) 📝 `docs/content/docs/en/reference/api/subscription-balancers.mdx` (+6 -6) 📝 `docs/public/openapi.json` (+937 -65) 📝 `frontend/public/openapi.json` (+937 -65) 📝 `frontend/scripts/build-openapi.mjs` (+109 -27) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+271 -107) ➕ `frontend/src/test/openapi-request-bodies.test.ts` (+140 -0) </details> ### 📄 Description ## Summary - Generate request-body schemas for JSON, URL-encoded form, and multipart endpoint parameters instead of silently dropping non-generic body locations - Preserve required fields, optional fields, defaults, conditional alternatives, binary uploads, top-level arrays, and repeated form-array encoding - Correct request metadata that the complete schemas exposed, including server logs, node IP sync, update endpoints, outbound subscriptions, and subscription balancers - Regenerate and synchronize the panel and documentation OpenAPI specifications ## Testing - `npm run test` - `npm run typecheck` - `npm run lint` - `npm run format:check` - `npm run build` - `pnpm test` - `pnpm typecheck` - `pnpm lint` - `pnpm format:check` - `pnpm build` - Verified Swagger serialization of repeated `inboundIds` form keys - Generated TypeScript definitions with `openapi-typescript` - Verified both committed OpenAPI specifications are byte-identical --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6213
No description provided.