Skip to content

docs: note that req.body may be undefined in v2#752

Open
Hashim1999164 wants to merge 1 commit into
expressjs:masterfrom
Hashim1999164:docs/note-undefined-body-v2
Open

docs: note that req.body may be undefined in v2#752
Hashim1999164 wants to merge 1 commit into
expressjs:masterfrom
Hashim1999164:docs/note-undefined-body-v2

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • Document the v1 to v2 behavior change where req.body stays undefined when no body is parsed, instead of always being initialized to {}.
  • Call out optional chaining / defaults for code that assumed an object.

Fixes #632

Test plan

  • Confirm the new note reads clearly in the README API section
  • Confirm it matches the breaking change already listed in HISTORY.md for 2.0.0

Document the v1 to v2 change where req.body stays undefined when no body
is parsed, instead of always being initialized to {}.

Fixes expressjs#632
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.

Migration Guide V1 -> V2

1 participant