Only decode nested resource when has nested meta values
@@ -85,6 +85,7 @@ func (processor *processor) decode() (errors []error) {
setter(processor.Result, metaValue, processor.Context)
}
+ if metaValue.MetaValues != nil && len(metaValue.MetaValues.Values) > 0 {
if res := metaValue.Meta.GetResource(); res != nil && !reflect.ValueOf(res).IsNil() {
field := reflect.Indirect(reflect.ValueOf(processor.Result)).FieldByName(meta.GetFieldName())
if utils.ModelType(field.Addr().Interface()) == utils.ModelType(res.NewStruct()) {
@@ -92,6 +93,7 @@ func (processor *processor) decode() (errors []error) {
}
}
}
+ }
return
}
