Skip to content

Commit 7f00ab7

Browse files
committed
fix(generator): stop re-injecting self-hosted Trading group on auto-publish (2.49.6)
ENDPOINT_GROUPS in scripts/generate-mintlify-docs.js was manufacturing a parallel 'Trading' + 'Orders & Positions' group from openapi.json on every release auto-publish, producing duplicate sidebar groups with 'Local Only' badges alongside the canonical hosted groups. Removed the matchers and added the self-hosted Group A opIds to HIDDEN_OPERATIONS. Cleaned the two stale duplicate groups left behind in docs.json by the 2.49.5 auto-publish.
1 parent 597c371 commit 7f00ab7

3 files changed

Lines changed: 37 additions & 58 deletions

File tree

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.49.6] - 2026-06-09
6+
7+
Generator-side hotfix for a regression introduced by the v2.49.5 auto-publish: the `generate:mintlify` step (`scripts/generate-mintlify-docs.js`, run by `.github/workflows/publish.yml` on every release tag) was re-injecting self-hosted Group A endpoints as a duplicate `"Trading"` group (with `"Local Only"` badges) into `docs.json`'s API Reference tab, sitting alongside the canonical hosted `"Trading"` group that this release line had just renamed and cleaned up. Result: every release pushed two same-named groups into the rendered sidebar.
8+
9+
### Fixed
10+
11+
- **`scripts/generate-mintlify-docs.js`**: Removed the hardcoded `"Trading"` and `"Orders & Positions"` entries from the `ENDPOINT_GROUPS` matcher array — the generator no longer manufactures those groups from the self-hosted `openapi.json`. Added the matching self-hosted operation ids (`createOrder`, `buildOrder`, `submitOrder`, `cancelOrder`, `editOrder`, `fetchOrder`, `fetchOpenOrders`, `fetchClosedOrders`, `fetchAllOrders`, `fetchMyTrades`, `fetchPositions`, `fetchBalance`, `fetchOrderHistory`) to the `HIDDEN_OPERATIONS` set so they don't fall through to the `"Other"` bucket either. Net effect: the next auto-publish keeps the manually-curated hosted `"Trading"` + `"Orders & Positions"` groups (rendered from `openapi-hosted-trading.json`) and never re-adds the self-hosted equivalents. Self-hosters who want the full reference still consume `openapi.json` directly or reach it via `/guides/self-hosted`.
12+
- **`docs/docs.json`**: Removed two stale duplicate groups (`"Trading (Hosted)"`, `"Orders & Positions (Hosted)"`) that the 2.49.5 auto-publish had left behind after the rename. The generator is now idempotent — regenerating produces a stable group list.
13+
514
## [2.49.5] - 2026-06-09
615

716
Sidebar cleanup: drop "(Hosted)" suffixes everywhere and hide the parallel self-hosted Group A reference. The hosted endpoints are now the only Group A surface in the sidebar; the API reference reads as "Trading → Create Order" instead of "Trading (Hosted) → Create Order (Hosted)."

docs/docs.json

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -171,29 +171,6 @@
171171
],
172172
"openapi": "api-reference/openapi.json"
173173
},
174-
{
175-
"group": "Trading",
176-
"pages": [
177-
"POST /api/{exchange}/createOrder",
178-
"POST /api/{exchange}/buildOrder",
179-
"POST /api/{exchange}/submitOrder",
180-
"POST /api/{exchange}/cancelOrder"
181-
],
182-
"openapi": "api-reference/openapi.json"
183-
},
184-
{
185-
"group": "Orders & Positions",
186-
"pages": [
187-
"GET /api/{exchange}/fetchOrder",
188-
"GET /api/{exchange}/fetchOpenOrders",
189-
"GET /api/{exchange}/fetchMyTrades",
190-
"GET /api/{exchange}/fetchClosedOrders",
191-
"GET /api/{exchange}/fetchAllOrders",
192-
"GET /api/{exchange}/fetchPositions",
193-
"GET /api/{exchange}/fetchBalance"
194-
],
195-
"openapi": "api-reference/openapi.json"
196-
},
197174
{
198175
"group": "Realtime",
199176
"pages": [
@@ -248,27 +225,6 @@
248225
"GET /v0/user/{address}/balances"
249226
]
250227
},
251-
{
252-
"group": "Trading (Hosted)",
253-
"openapi": "api-reference/openapi-hosted-trading.json",
254-
"pages": [
255-
"POST /v0/trade/create-order",
256-
"POST /v0/trade/build-order",
257-
"POST /v0/trade/submit-order",
258-
"POST /v0/orders/cancel/build"
259-
]
260-
},
261-
{
262-
"group": "Orders & Positions (Hosted)",
263-
"openapi": "api-reference/openapi-hosted-trading.json",
264-
"pages": [
265-
"GET /v0/orders/{order_id}",
266-
"GET /v0/orders/open",
267-
"GET /v0/user/{address}/trades",
268-
"GET /v0/user/{address}/positions",
269-
"GET /v0/user/{address}/balances"
270-
]
271-
},
272228
{
273229
"group": "Enterprise",
274230
"openapi": "api-reference/openapi-hosted.json",

scripts/generate-mintlify-docs.js

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,13 @@ const ENDPOINT_GROUPS = [
162162
opId
163163
),
164164
},
165-
{
166-
name: 'Trading',
167-
match: (opId) =>
168-
/^(createOrder|buildOrder|submitOrder|cancelOrder|editOrder)$/.test(
169-
opId
170-
),
171-
},
172-
{
173-
name: 'Orders & Positions',
174-
match: (opId) =>
175-
/^(fetchOrder|fetchOpenOrders|fetchClosedOrders|fetchAllOrders|fetchMyTrades|fetchPositions|fetchBalance|fetchOrderHistory)$/.test(
176-
opId
177-
),
178-
},
165+
// "Trading" and "Orders & Positions" groups are intentionally NOT
166+
// generated from the self-hosted openapi.json spec. The canonical
167+
// surfaces for those endpoints are the hosted groups in docs.json
168+
// (preserved via the `otherExternalGroups` path below) which render
169+
// from openapi-hosted-trading.json. Auto-generating the self-hosted
170+
// equivalents here would produce two same-named groups in the API
171+
// Reference sidebar (one with "Local Only" badges, one without).
179172
{
180173
name: 'Realtime',
181174
match: (opId) => /^(watch|unwatch)/.test(opId),
@@ -225,6 +218,27 @@ const HIDDEN_OPERATIONS = new Set([
225218
'fetchEventMatches',
226219
'fetchMarketMatches',
227220
'testDummyMethod',
221+
// Self-hosted Group A endpoints (`/api/{exchange}/createOrder`, etc.)
222+
// are intentionally hidden from the auto-generated sidebar. The
223+
// canonical "Trading" + "Orders & Positions" surfaces are the hosted
224+
// groups in docs.json that render from openapi-hosted-trading.json.
225+
// Auto-generating self-hosted equivalents would produce two same-named
226+
// groups (one with "Local Only" badges, one without). Self-hosters
227+
// still get the spec at docs/api-reference/openapi.json and reach the
228+
// endpoints via /guides/self-hosted.
229+
'createOrder',
230+
'buildOrder',
231+
'submitOrder',
232+
'cancelOrder',
233+
'editOrder',
234+
'fetchOrder',
235+
'fetchOpenOrders',
236+
'fetchClosedOrders',
237+
'fetchAllOrders',
238+
'fetchMyTrades',
239+
'fetchPositions',
240+
'fetchBalance',
241+
'fetchOrderHistory',
228242
]);
229243

230244
// Convert an operationId to its expected MDX file path (docs-relative,

0 commit comments

Comments
 (0)