Skip to content

docs: fix incorrect defaults and code examples in Server.md - #6805

Merged
Eomm merged 3 commits into
fastify:mainfrom
Adit-Jain-srm:docs/fix-server-routes-reference-errors
Jul 5, 2026
Merged

Eomm merged 3 commits into
fastify:mainfrom
Adit-Jain-srm:docs/fix-server-routes-reference-errors

Conversation

@Adit-Jain-srm

Copy link
Copy Markdown
Contributor

Fixes #6767

Corrects four documentation inaccuracies in docs/Reference/Server.md:

  1. genReqId note (line ~523): stated requestIdHeader defaults to 'request-id', but the actual default is false (see fastify.js line 877).

  2. frameworkErrors example (line ~724): the handler parameter is error but the example referenced undefined err.

  3. buildPrettyMeta example (lines ~849-863): was incorrectly nested inside a route handler (fastify.get(...)), making it syntactically invalid. Corrected to show it as a factory routerOptions configuration.

  4. querystringParser under routerOptions (lines ~1065-1093): stated the default is "Node.js's core querystring module" and imported node:querystring in the example. The actual default is fast-querystring, matching the description in the top-level factory option section.

Bug 3 from the issue (serializerCompiler double braces in Routes.md) appears to already be fixed on main.

- Fix genReqId note: requestIdHeader defaults to false, not request-id

- Fix frameworkErrors example: use error (the param name), not err

- Fix buildPrettyMeta example: show as factory option, not inside route

- Fix routerOptions querystringParser: default is fast-querystring, not node:querystring

Fixes fastify#6767
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jun 20, 2026
@Fdawgs
Fdawgs requested a review from Copilot June 21, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR corrects several inaccuracies and broken snippets in docs/Reference/Server.md, aligning documentation defaults and examples with Fastify’s actual behavior and intended usage.

Changes:

  • Fixes requestIdHeader default noted under genReqId to false.
  • Corrects a frameworkErrors example to send the defined error variable.
  • Makes the buildPrettyMeta example syntactically valid by showing it in routerOptions, and updates the routerOptions.querystringParser section to reflect fast-querystring as the default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/Reference/Server.md Resolved
Comment thread docs/Reference/Server.md Resolved
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Signed-off-by: Adit Jain <[email protected]>
@Eomm
Eomm merged commit 826c807 into fastify:main Jul 5, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: incorrect defaults, variable names, and code examples in Server.md and Routes.md

4 participants