express.urlencoded([options]) documentation says that extended option is true by default. But node shows a deprecated warning.
let express = require('express');
let router = express.Router();
router.post("/create", express.urlencoded(), function (request, response) {
});
body-parser deprecated undefined extended: provide extended option
There is no warning if I set extended explicitly:
express.urlencoded({ extended: true })
NodeJS v10.0.0
express 4.16.3
It is true by default. It's just deprecated to rely on the default value.
So does default value make sense here? Can change it to unassigned and need to be assigned explicitly in code? At least some note in the document will help.
Gotcha. I didn't really understand what your ask was, and thought it was just a question, sorry. I'm still not 100% clear on what you're asking to change, if anything. Would you be open to making a pull request with your suggestions?
Sorry for my English :)
The documentation says extended is true by default. But it isn't correct in next major release of body-parser, that's why deprecated warning is shown (in current release) if extended isn't explicitly assigned a value . I suggested to change true in the Default column to Unassigned (and required).
But the value is true by default.
It was, and it is still correct now but clearly body-parser owner doesn't want us rely on this more. You could keep extended documentation unchanged and people see the deprecated warning with a little surprise. Or you tell them extended is a required option. I vote the latter point :)
A deprecation warning doesn't make something required. (1) anyone can simply silence deprecation warnings and (2) the code functions just fine.
If you think the docs can be improved, please feel free to open a pull request with the suggested changes :+1:
Most helpful comment
A deprecation warning doesn't make something required. (1) anyone can simply silence deprecation warnings and (2) the code functions just fine.
If you think the docs can be improved, please feel free to open a pull request with the suggested changes :+1: