@devries-cameron20 / composio-1 / commits / f3dd9343e
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(docs): preserve inline API paths in generated SDK reference (#3619)

## Summary The TypeScript SDK reference generator (`generate-docs.ts`) strips every `api/vN/...` substring from JSDoc descriptions to keep raw endpoint paths out of user-facing docs. The blanket regex also strips paths that live **inside intentional inline-code spans**, mangling them. Concretely, `ConnectedAccounts.initiate()`'s JSDoc: > The legacy `` `POST /api/v3/connected_accounts` `` endpoint that this method … currently renders in the generated reference as: > The legacy `` `POST `` endpoint that this method … — content lost and an unclosed code span. (Visible today in `docs/content/reference/sdk-reference/typescript/connected-accounts.mdx`.) ## Fix In `extractDescription`, split the text on inline-code spans and only strip bare API paths **outside** backticks; deliberate route references inside code spans are left intact. The path regex is also tightened to stop at code-span and punctuation boundaries (`` ` ``, `)`, `,`, `.`, `;`). The single affected reference page is regenerated in the same commit. ## Verification - `pnpm --filter @composio/core generate:docs` → only `connected-accounts.mdx` changes, restoring the full `` `POST /api/v3/connected_accounts` `` span. ## Context Salvaged from the now-superseded #3518 — re-derived against the current generator. The rest of #3518 (drift-gate workflow, regenerated MDX, generator rework) is obsoleted by the post-merge auto-regeneration workflow (`generate-sdk-docs.yml`) and #3613.

Alberto Schiabel committed Jun 20, 2026 at 00:22 UTC f3dd9343e67a3048bc98e310e03033fbf84e8d16
2 files changed +10 -3
docs/content/reference/sdk-reference/typescript/connected-accounts.mdx
+1 -1
@@ -145,7 +145,7 @@ This function creates a new connected account and returns a connection request.
145 Users can then wait for the connection to be established using the `waitForConnection` method.
146
147 **Deprecated for Composio-managed OAuth (OAuth1, OAuth2, DCR_OAUTH).**
148 -The legacy `POST endpoint that this method
148 +The legacy `POST /api/v3/connected_accounts` endpoint that this method
149 wraps is being retired for Composio-managed auth configs on redirectable
150 schemes. The cutover is **2026-05-08** for new organizations and
151 **2026-07-03** for all remaining organizations. After your org's cutover,
ts/packages/core/scripts/generate-docs.ts
+9 -2
@@ -226,8 +226,15 @@ function extractDescription(comment?: TypeDocReflection['comment']): string {
226 if (!comment) return '';
227 let desc = extractText(comment.summary);
228
229 - // Clean up API paths that shouldn't be in user-facing docs
230 - desc = desc.replace(/\/?api\/v\d+\/[^\s]*/g, '').trim();
229 + // Clean up bare API paths that shouldn't be in user-facing docs, while
230 + // preserving intentional route references inside inline code spans.
231 + desc = desc
232 + .split(/(`[^`]*`)/g)
233 + .map(segment =>
234 + segment.startsWith('`') ? segment : segment.replace(/\/?api\/v\d+\/[^\s`),.;]*/g, '')
235 + )
236 + .join('')
237 + .trim();
238
239 // Clean up multiple newlines and spaces
240 desc = desc