.default()
does not work with Number 0
as value when used with checkSchema
#1086
Labels
.default()
does not work with Number 0
as value when used with checkSchema
#1086
Describe the bug
The
default
sanitizer should set default value to missing or null values.Although, it doesn't work when we use it inside a schema and we want to set value to the Number
0
.To Reproduce
Simple script to reproduce:
With express-validator 6.12.1 the output is:
Expected behavior
With same program, the expected behavior is to get
0
with the/schema/number
route, as the/chain/number
does:Current behavior
See above.
Environment:
The text was updated successfully, but these errors were encountered: