Add slice elements check for not required slice
This commit is contained in:
		| @ -209,6 +209,11 @@ func Validate(obj interface{}, parents ...string) error { | |||||||
| 					if err != nil { | 					if err != nil { | ||||||
| 						return err | 						return err | ||||||
| 					} | 					} | ||||||
|  | 				} else if fieldType == reflect.Slice && field.Type.Elem().Kind() == reflect.Struct { | ||||||
|  | 					err := Validate(fieldValue, field.Name) | ||||||
|  | 					if err != nil { | ||||||
|  | 						return err | ||||||
|  | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user