From be6d8326a84787378abbe8bddda779a6d04ccc7f Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Mon, 4 Nov 2024 10:15:20 -0500 Subject: [PATCH] Add ability to output json lists in metadata build file Signed-off-by: Laurent Goderre --- commands/build.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/build.go b/commands/build.go index e0e21761e56..1904a02da2e 100644 --- a/commands/build.go +++ b/commands/build.go @@ -763,8 +763,11 @@ func decodeExporterResponse(exporterResponse map[string]string) map[string]inter } var raw map[string]interface{} if err = json.Unmarshal(dt, &raw); err != nil || len(raw) == 0 { - out[k] = v - continue + var rawList []map[string]interface{} + if err = json.Unmarshal(dt, &rawList); err != nil || len(rawList) == 0 { + out[k] = v + continue + } } out[k] = json.RawMessage(dt) }