parameter icon indicating copy to clipboard operation
parameter copied to clipboard

value is null should not validate

Open gaochengyidlmu opened this issue 7 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

Codecov Report

Merging #42 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #42   +/-   ##
======================================
  Coverage    99.5%   99.5%           
======================================
  Files           1       1           
  Lines         201     201           
  Branches       73      73           
======================================
  Hits          200     200           
  Misses          1       1
Impacted Files Coverage Δ
index.js 99.5% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update eadccb1...4d5e213. Read the comment docs.

codecov-io avatar Jul 02 '18 07:07 codecov-io

这么好的提案,为什么没有通过合并呢。

konglingwen94 avatar Dec 10 '20 06:12 konglingwen94