Skip to content

Feature request: return parsed params #23

@paulish

Description

@paulish

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions