diff --git a/lib/schematype.js b/lib/schematype.js index 2cd0caf0858..fbce0e0dce6 100644 --- a/lib/schematype.js +++ b/lib/schematype.js @@ -798,6 +798,17 @@ const handleIsAsync = util.deprecate(function handleIsAsync() {}, SchemaType.prototype.required = function(required, message) { let customOptions = {}; + + if (arguments.length > 0 && required == null) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.requiredValidator; + }, this); + + this.isRequired = false; + delete this.originalRequiredValue; + return this; + } + if (typeof required === 'object') { customOptions = required; message = customOptions.message || message;