Skip to content

fix(website): mark default-valued params as optional in api-docs generator#631

Merged
blove merged 4 commits into
mainfrom
claude/fix-api-docs-default-param
Jun 8, 2026
Merged

fix(website): mark default-valued params as optional in api-docs generator#631
blove merged 4 commits into
mainfrom
claude/fix-api-docs-default-param

Conversation

@blove

@blove blove commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes the follow-up flagged during the chat + ag-ui docs technical reviews. TypeDoc only sets the isOptional flag for ?-marked params, not for params with a default value (e.g. mockAgent(opts: MockAgentOptions = {})), so the generated API reference rendered those as required.

Fix: in generate-api-docs.ts, a parameter is optional if isOptional or it has a defaultValue.

Regenerated all libs: 14 default-valued params across 5 libs now correctly show optional (e.g. mockAgent opts, and similar = {} / = [] params). The generated-JSON diff is optional-flag flips only — no signature, type, name, or structure change.

Test Plan

  • eslint clean on the generator.
  • npm run generate-api-docs succeeds for all 7 libs.
  • Diff verified: only "optional": falsetrue lines changed; mockAgent.opts now optional: true.
  • API reference pages render HTTP 200.

🤖 Generated with Claude Code

…rator

TypeDoc only sets the `isOptional` flag for `?`-marked params, not for
params with a default value (e.g. `mockAgent(opts: MockAgentOptions = {})`),
so those were rendered as required. Treat `defaultValue !== undefined` as
optional too. Regenerated: 14 default-valued params across 5 libs now show
optional (e.g. mockAgent `opts`); diff is optional-flags only.

Closes the follow-up flagged during the chat + ag-ui docs technical reviews.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@blove blove enabled auto-merge (squash) June 8, 2026 20:04
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jun 8, 2026 8:26pm

Request Review

@blove blove merged commit c818631 into main Jun 8, 2026
24 checks passed
blove added a commit that referenced this pull request Jun 9, 2026
…rator (#631)

TypeDoc only sets the `isOptional` flag for `?`-marked params, not for
params with a default value (e.g. `mockAgent(opts: MockAgentOptions = {})`),
so those were rendered as required. Treat `defaultValue !== undefined` as
optional too. Regenerated: 14 default-valued params across 5 libs now show
optional (e.g. mockAgent `opts`); diff is optional-flags only.

Closes the follow-up flagged during the chat + ag-ui docs technical reviews.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant