It would be nice to get parsed parameters after the validation process.
Imagine you have a request:
/**
* GET /visit/list
* @summary get list of visits
* @param {string} some-header-param.header - some header string value
* @param {boolean} booleanParam.query - some boolean value
* @param {integer} intParam.query - some integer value
*/
router.get('/list', validateRequest(), async (req, res) => {
const someHeaderParam = req.headers[''];
const {booleanParam, intParam} = req.query;
// the problem:
// we need to gather params from header, query, body and path and to convert there values to previously described types
// here booleanParam and intParam are string and we need to explicitly convert them before use
});
The suggest is to either set some req property to parsed list of params or to introduce another method to simplify request object parsing.
It would be nice to get parsed parameters after the validation process.
Imagine you have a request:
The suggest is to either set some req property to parsed list of params or to introduce another method to simplify request object parsing.