diff --git a/lib/utils/rules.js b/lib/utils/rules.js index c79a16d1..59484841 100644 --- a/lib/utils/rules.js +++ b/lib/utils/rules.js @@ -15,7 +15,7 @@ export const getRules = (schema, fullSchema, options, required, isOneOfSelect) = } if (fullSchema.type === 'string' && fullSchema.minLength !== undefined) { const msg = options.messages.minLength.replace('{minLength}', fullSchema.minLength.toLocaleString(options.locale)) - rules.push((val) => (val === undefined || val === null || val.length >= fullSchema.minLength) || msg) + rules.push((val) => (val === undefined || val === null || (!required && val === '') || val.length >= fullSchema.minLength) || msg) } if (fullSchema.type === 'string' && fullSchema.maxLength !== undefined) { const msg = options.messages.maxLength.replace('{maxLength}', fullSchema.maxLength.toLocaleString(options.locale))