Bug: Wildcard example is not working
See original GitHub issueDescribe the bug
Wildcard rules don’t seem to be checked.
To Reproduce
Run the following code and make a request with an empty post:
const express = require('express')
const { check, sanitize, validationResult } = require('express-validator');
const app = express()
app.use(express.json());
const port = 3001
app.post('/', [
check('addresses.*').isPostalCode(),
], (req, res) => {
const errors = validationResult(req);
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() });
}
res.send('Hello World!1')
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
})
Expected behavior
I expected some validation errors to pop out.
Current behavior
No errors.
Express-validator version:
- Version: 6.6.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
* Wildcard not working in code search - Visual Studio Feedback
I'm trying to search all the words that contain "date" in a certain path. The * wildcard does not work as expected though....
Read more >Is this unpredictable Word wildcard replace bug ever going to be
This bug appears regardless of whether View Markup is ON/OFF. For example in a numbered list, replacing a space after '.' to a...
Read more >507074 – removing files using wildcard isn't working
Description of problem: I think there is a bug in "rm-rf" (possibly "rm" and "command" too) command. If I try to remove some...
Read more >Wildcard grants do not work when partial-revokes is enabled
Suggested fix: Either make wildcards for regular grants actually work as documented also when partial-revokes is enabled, or update the ...
Read more >Wildcard bug in FileZilla 1.1.0
The problem is that the behavior is often hardcoded and not changeable by the user. What harm would it do to implement it,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sure, but you have to use a custom validator 😃
Hi, can you add also the body of the failing request, please? It would definitely help to understand better where the error comes from.