Menu

#21 enum does not accept empty value

v1.0_(example)
open
nobody
None
5
2014-09-11
2014-09-11
Evert Mouw
No

When using an enum, the yml file did not validate is the field was empty, even when the field was not required.

As a workaround, I have used a regexp. Luckily, by default the field contains a space, to I could tell the pattern to accept that as well.

#enum: [fixed, click, variable]
pattern: /fixed|click|variable|[ ]/

Best is of course to have an enum that, if the field is not required, also accepts "no value".

Discussion


Log in to post a comment.

MongoDB Logo MongoDB