expressjs / expressjs/body-parser
Conform with express-validator on parameter representation
- Dominant language
- JavaScript
- Stars
- 5.5k
- Forks
- 767
- Avg merge
- 13h 53m
- Merged PRs (30d)
- 10
Description
`body-parser` and `express-validator` are both commonly used packages to process HTML forms. They are a pretty good fit aswell, since the parser allows the parsing of nested objects, and the validator allows the validation of nested objects. The shortcoming is when representing the `param` field of a validation error.
Currently, as far as I can see, there is no way to tell the body parser to use the "dot syntax", where nested objects are represented as `my.nested.object` instead of `my[nested][object]` in the HTML input names. The validator however, returns the parameter names in precisely this format, and I cannot seem to find a way to change this.
Is it possible to provide a parameter to the `urlencoded` options that allows the activation of `qs`'s `allowDots` option? Then the fields names could be written in the dot format, parsed in the dot format and validated in the dot format.
Contributor guide
Assessment
This issue has not been assessed yet.