mirror of
https://github.com/rancher/norman.git
synced 2025-07-02 02:03:03 +00:00
Merge pull request #245 from alena1108/jan29
MinLength verification bug fix
This commit is contained in:
commit
196df5ed9d
@ -264,7 +264,7 @@ func CheckFieldCriteria(fieldName string, field types.Field, value interface{})
|
||||
}
|
||||
}
|
||||
|
||||
if hasStrVal {
|
||||
if hasStrVal || value == "" {
|
||||
if field.MinLength != nil && int64(len(strVal)) < *field.MinLength {
|
||||
return httperror.NewFieldAPIError(httperror.MinLengthExceeded, fieldName, "")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user