Skip to content

Conversation

@tstanmay13
Copy link
Contributor

Description

Refs: Slack thread from @tstanmay13

Fixes a bug in the TypeScript SDK reference.md generator where APIs with multiple root-level endpoints would only show the last endpoint in the documentation, and an empty ## section header would appear.

Link to Devin run: https://app.devin.ai/sessions/ef19d2dcf49047abbf9983055b0331fa
Requested by: [email protected] (@tstanmay13)

Changes Made

  • Moved section creation (addRootSection() or addSection()) outside the endpoint loop in generateSnippets()
  • Previously, addRootSection() was called inside the endpoint loop for root packages, which replaced the root section on each iteration (discarding previous endpoints)
  • Now uses a ternary to create the appropriate section type once before iterating through endpoints
  • This aligns with the pattern used in other generators (Go, PHP, Ruby, etc.)

Testing

  • Ran seed tests for multiple-request-bodies, alias, and extends fixtures
  • Verified reference.md output now includes all root endpoints
  • Verified empty ## section headers are removed
  • Lint checks pass

Human Review Checklist

  • Verify the logic change correctly moves section creation outside the endpoint loop
  • Confirm seed output changes look correct (endpoints appear, empty headers removed)

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration bot changed the title fix(ts-sdk): Fix reference.md generation for APIs with multiple root-level endpoints fix(typescript): Fix reference.md generation for APIs with multiple root-level endpoints Dec 10, 2025
@tstanmay13 tstanmay13 enabled auto-merge (squash) December 10, 2025 21:47
@tstanmay13 tstanmay13 merged commit 32c7afb into main Dec 10, 2025
129 of 130 checks passed
@tstanmay13 tstanmay13 deleted the devin/1765399128-fix-ts-reference-root-endpoints branch December 10, 2025 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants