Skip to content

docs(server): fix contradictory requestIdHeader default - #6872

Merged
Eomm merged 1 commit into
fastify:mainfrom
sobol-sudo:docs/requestid-header-default
Jul 26, 2026
Merged

Eomm merged 1 commit into
fastify:mainfrom
sobol-sudo:docs/requestid-header-default

Conversation

@sobol-sudo

Copy link
Copy Markdown
Contributor

The requestIdHeader section of docs/Reference/Server.md carries two + Default: lines with opposite values, and the wrong one is the one readers hit first:

570: + Default: `'request-id'`
...
578: By default `requestIdHeader` is set to `false` and will immediately use genReqId
...
582: + Default: `false`

false is the correct one:

  • require('fastify')().initialConfig.requestIdHeader is false on 5.x
  • build/build-validation.js:42 → requestIdHeader: false
  • lib/config-validator.js:60-61 → if (data.requestIdHeader === undefined) { data.requestIdHeader = false }
  • fastify.js:875 → the header name is only used when requestIdHeader === true or a non-empty string

Origin, in case it's useful: 7381195d (#4194, "Change request id header default value to false") corrected the single + Default: line at the bottom of the section on the v5 next branch, while bf01ba44 (#4904, docs restructure) independently moved a copy of the old line up under the heading on v4 main. The merge aceab549 kept both.

This fixes the line under the heading and drops the duplicate lower down, matching the 28-of-31 convention in this file of putting + Default: directly under the option heading.

Separately, ### genReqId just below still documents its default as "value of 'request-id' header if provided…", which reads stale for the same reason — happy to follow up on that in its own PR if you want it changed.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 24, 2026
@Eomm
Eomm merged commit ff7eff5 into fastify:main Jul 26, 2026
4 of 5 checks passed
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants