From 3b546369d87c6b63b62d8bae118aa1cf5c0a3e32 Mon Sep 17 00:00:00 2001 From: "zhuangjie.1125" Date: Wed, 23 Jul 2025 15:50:52 +0800 Subject: [PATCH] feat(backend): when the convert array element contains an object, waring information occurs, and the object needs to be added to the array element as well --- backend/domain/workflow/internal/compose/field_fill.go | 3 +++ backend/domain/workflow/internal/nodes/convert.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/backend/domain/workflow/internal/compose/field_fill.go b/backend/domain/workflow/internal/compose/field_fill.go index 6bb78115..90371ac8 100644 --- a/backend/domain/workflow/internal/compose/field_fill.go +++ b/backend/domain/workflow/internal/compose/field_fill.go @@ -154,6 +154,9 @@ func FillIfNotRequired(tInfo *vo.TypeInfo, container map[string]any, k string, s } newSubContainer := maps.Clone(subContainer) + if newSubContainer == nil { + newSubContainer = make(map[string]any) + } for subK, subL := range elemTInfo.Properties { if err := FillIfNotRequired(subL, newSubContainer, subK, strategy, true); err != nil { diff --git a/backend/domain/workflow/internal/nodes/convert.go b/backend/domain/workflow/internal/nodes/convert.go index 2cd9b225..a1915f95 100644 --- a/backend/domain/workflow/internal/nodes/convert.go +++ b/backend/domain/workflow/internal/nodes/convert.go @@ -391,6 +391,9 @@ func convertToArray(ctx context.Context, in any, path string, t *vo.TypeInfo, op if err != nil { return nil, nil, err } else if ws != nil { + if elemType.Type == vo.DataTypeObject { // If the array type and the element is an object, the converted object will also need to be added to the array when waring occurs + out = append(out, newV) + } warnings = append(warnings, *ws...) } else { // only correctly converted elements go into the final array out = append(out, newV)