diff --git a/binding/binding.go b/binding/binding.go index 99f3d0e1..b49f1e5c 100644 --- a/binding/binding.go +++ b/binding/binding.go @@ -199,6 +199,22 @@ func Validate(obj interface{}, parents ...string) error { return err } } + } else { + fieldType := field.Type.Kind() + if fieldType == reflect.Struct { + if reflect.DeepEqual(zero, fieldValue) { + continue + } + err := Validate(fieldValue, field.Name) + if err != nil { + return err + } + } else if fieldType == reflect.Slice && field.Type.Elem().Kind() == reflect.Struct { + err := Validate(fieldValue, field.Name) + if err != nil { + return err + } + } } } case reflect.Slice: