parameter icon indicating copy to clipboard operation
parameter copied to clipboard

value is null should not validate

Open gaochengyidlmu opened this issue 6 years ago • 2 comments

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' }

gaochengyidlmu avatar Jul 02 '18 07:07 gaochengyidlmu