feat(docs): per-method hosted/self-hosted toggle on Group A reference pages (v2.49.2)#979
Open
realfishsam wants to merge 2 commits into
Open
feat(docs): per-method hosted/self-hosted toggle on Group A reference pages (v2.49.2)#979realfishsam wants to merge 2 commits into
realfishsam wants to merge 2 commits into
Conversation
… pages (v2.49.2) Every Group A method (createOrder, buildOrder, submitOrder, cancelOrder, fetchBalance, fetchPositions, fetchOpenOrders, fetchMyTrades, fetchOrder, fetchClosedOrders, fetchAllOrders) now has a synchronized Hosted / Self-hosted tab toggle. Hosted is the default tab; Mintlify syncs tab selection across pages via shared label keys so the choice persists. Added: - 11 shadow MDX files under docs/api-reference/ (one per Group A method) wrapping the existing OpenAPI auto-render in a <Tabs> toggle. - 9 new operations in openapi-hosted.json documenting the trade.pmxt.dev/v0/* surface — build/submit/create/cancel order plus the 5 read endpoints. Each has Python + TypeScript x-codeSamples with the v2.49 hosted constructor shape and error responses covering 401/403/404/410/422/503. - 10 new component schemas referencing existing components from 2.49.1. - docs.json updated so Trading + Orders & Positions sidebar groups point at the shadow MDX slugs. Fixed: - createOrder/buildOrder code-sample JSDoc rot — pages used to show type="market" with price=0.55 (price is only meaningful on limits). PARAM_OVERRIDES in generate-openapi.js now emits coherent limit samples across all 16 venues (64 lines updated). Not addressed (flagged for follow-up): - fetchClosedOrdersHosted / fetchAllOrdersHosted — both raise NotSupported in hosted mode (no underlying endpoint). Shadow MDX surfaces this with a <Warning> linking to fetchMyTrades. - Escrow methods — hosted-only, not in Group A scope. - Generator capability-map omits Hyperliquid/GeminiTitan/Mock — drops their x-codeSamples on regeneration. Merged main retains them from a prior generator run. Real fix is out of scope. Tests: tsc --noEmit clean from core/; all 3 JSON files parse cleanly. Mintlify CLI unavailable locally — cross-page tab sync relies on the documented Mintlify convention (verified post-merge in the deploy).
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
The shadow MDX pages array already enumerates the toggle pages; the openapi: spec reference was causing Mintlify to auto-inject every operation in openapi.json under those groups, polluting the sidebar with 'API Reference / Local Only / Hosted / Data Feeds' sub-groups below the 11 shadow MDX pages.
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.
Follow-up to v2.49.1. Adds a synchronized
Hosted (recommended)/Self-hostedtab toggle to every Group A method reference page so customers see the hosted endpoint and v2.49 SDK constructor shape by default, and can flip to the local-sidecar variant in place. Mintlify syncs tab selection across pages via shared label keys.What's in this PR
11 shadow MDX files (
docs/api-reference/{buildOrder,cancelOrder,createOrder,fetchAllOrders,fetchBalance,fetchClosedOrders,fetchMyTrades,fetchOpenOrders,fetchOrder,fetchPositions,submitOrder}.mdx) — each wraps the existing OpenAPI auto-render in a<Tabs>toggle. Tab labels byte-identical across all 11 files for cross-page sync.9 new operations in
openapi-hosted.jsondocumentingtrade.pmxt.dev/v0/*: buildOrderHosted, submitOrderHosted, createOrderHosted, cancelOrderHosted, fetchBalanceHosted, fetchPositionsHosted, fetchOpenOrdersHosted, fetchMyTradesHosted, fetchOrderHosted. Each with Python + TypeScriptx-codeSamples, error coverage 401/403/404/410/422/503, bearer auth.10 new component schemas for the v0 request/response shapes, reusing existing components from 2.49.1.
docs.jsonupdated so Trading + Orders & Positions sidebar groups point at the shadow MDX slugs.JSDoc rot fix:
createOrder/buildOrdercode samples used to showtype="market"withprice=0.55(incoherent — price is limit-only). Replaced with coherent limit samples across all 16 venues viaPARAM_OVERRIDESin the generator.Changelog 2.49.2 entry added.
Not addressed (flagged in changelog)
fetchClosedOrdersHosted/fetchAllOrdersHostedraiseNotSupportedin hosted mode (no underlying endpoint). Shadow MDX surfaces this via<Warning>linking tofetchMyTrades.Test plan
Self-hostedoncreateOrder→ navigate tofetchBalance→ confirm Self-hosted tab is still active (sync)