Skip to content

Conversation

@krzysdz
Copy link
Contributor

@krzysdz krzysdz commented Apr 24, 2025

The body-parser change that no longer sets req.body = {} is noted in migration guide and v5 release post, but has not been reflected in express.json(), express.raw(), express.text() and express.urlencoded() API documentation.

Found by @LorenzoLeonardini in expressjs/express#6432 (comment).

express.raw() and express.text() had own .md files with docs, but were not included in express.md and menu.md (see 8225868 for 4.x) - #1881

@krzysdz krzysdz requested review from a team as code owners April 24, 2025 10:20
@netlify
Copy link

netlify bot commented Apr 24, 2025

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 498c1b1
🔍 Latest deploy log https://app.netlify.com/sites/expressjscom-preview/deploys/680c52767eebc80008429326
😎 Deploy Preview https://deploy-preview-1883--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@krzysdz krzysdz changed the title Reflect body-parser changes in 5.x API docs Reflect body-parser changes in 5.x API docs and include those docs where missing Apr 24, 2025
Comment on lines +7 to +10
<li id="express-raw-middleware"><a href="#express.raw">express.raw()</a></li>
<li id="express-router"><a href="#express.router">express.Router()</a></li>
<li id="express-static-middleware"><a href="#express.static">express.static()</a></li>
<li id="express-text-middleware"><a href="#express.text">express.text()</a></li>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added the menu entries with ids suffixed with -middleware for consistency, but in 4.x express.raw() and express.text() menu items have no such suffix in ids.

I don't think anyone makes links with anchors to menu elements, so it should be ok.

<li id="express-json-middleware"><a href="#express.json">express.json()</a></li>
<li id="express-raw"><a href="#express.raw">express.raw()</a></li>
<li id="express-router"><a href="#express.router">express.Router()</a></li>
<li id="express-static-middleware"><a href="#express.static">express.static()</a></li>
<li id="express-text"><a href="#express.text">express.text()</a></li>
<li id="express-urlencoded-middleware"><a href="#express.urlencoded">express.urlencoded()</a></li>

@krzysdz krzysdz changed the title Reflect body-parser changes in 5.x API docs and include those docs where missing Reflect body-parser changes in 5.x API docs and include those that where missing Apr 25, 2025
@bjohansebas bjohansebas merged commit e69208e into expressjs:gh-pages Apr 26, 2025
7 checks passed
@bjohansebas
Copy link
Member

thanks @krzysdz!

@krzysdz krzysdz deleted the 5.x-body-parser-no-body branch April 26, 2025 21:12
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.

2 participants