fix: array constraint validation only if value was provided (#7112)
This commit is contained in:
@@ -429,11 +429,12 @@ function validateValueBySchema(value, schema, requiredByParam, bypassRequiredChe
|
||||
let minItems = schema.get("minItems")
|
||||
let pattern = schema.get("pattern")
|
||||
|
||||
const needsExplicitConstraintValidation = type === "array"
|
||||
const schemaRequiresValue = requiredByParam || requiredBySchema
|
||||
const hasValue = value !== undefined && value !== null
|
||||
const isValidEmpty = !schemaRequiresValue && !hasValue
|
||||
|
||||
const needsExplicitConstraintValidation = hasValue && type === "array"
|
||||
|
||||
const requiresFurtherValidation =
|
||||
schemaRequiresValue
|
||||
|| needsExplicitConstraintValidation
|
||||
|
||||
Reference in New Issue
Block a user