-
-
Notifications
You must be signed in to change notification settings - Fork 621
Open
Labels
Description
Describe the bug
The isNumeric should throw the error message for the array but it does not
To Reproduce
See this example code
[
checkSchema({
id: {
in: ['body'],
exists: {
errorMessage: 'ID is required',
},
isNumeric: {
errorMessage: 'ID must be a number',
},
},
}),
]When I send a request with this body:
{
"id": []
}It sees the array as a number and then it passes the validation
Expected behavior
IT should reject the request because the value is not a number
Current behavior
IT should reject the request because the value is not a number
Environment:
- Express-validator version: 7.2.0
- Express version: 4.21.2
- Node.js version: 20.15.1