Skip to content

Commit

Permalink
Update object.go
Browse files Browse the repository at this point in the history
  • Loading branch information
aacebo committed Oct 7, 2024
1 parent ad53d7b commit 26708f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion object.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ func (self ObjectSchema) validateStruct(key string, value reflect.Value) error {
continue
}

field := value.FieldByName(fieldName)
field := reflect.Indirect(value.FieldByName(fieldName))

if field.Kind() == reflect.Interface {
field = field.Elem()
}

if e := schema.validate(name, field); e != nil {
err = err.Add(e)
Expand Down

0 comments on commit 26708f4

Please sign in to comment.