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

main
zhuangjie.1125 3 months ago
parent 59729f01b2
commit 3b546369d8
  1. 3
      backend/domain/workflow/internal/compose/field_fill.go
  2. 3
      backend/domain/workflow/internal/nodes/convert.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 {

@ -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)

Loading…
Cancel
Save