parameter
parameter copied to clipboard
value is null should not validate
I have the problem.
I want to set some value to null. but it throw an error.
const rule = { transferDate: {type: 'string', required: false, allowEmpty: true}}
let someData = {transferDate: '2018-07-02'}
req.body = {transferDate: null}
{ message: 'should be a string', code: 'invalid', field: 'transferDate' }