From d012ed843fb2bc13c9701c924ee5e3d8ce5f7d46 Mon Sep 17 00:00:00 2001 From: sarahCx Date: Tue, 20 Aug 2024 11:02:53 +0300 Subject: [PATCH] array initialization for schema validation --- internal/commands/result.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/commands/result.go b/internal/commands/result.go index 8a24c26b2..db3f88fd1 100644 --- a/internal/commands/result.go +++ b/internal/commands/result.go @@ -1471,7 +1471,10 @@ func exportGlSastResults(targetFile string, results *wrappers.ScanResultsCollect func exportGlScaResults(targetFile string, results *wrappers.ScanResultsCollection, summary *wrappers.ResultSummary) error { log.Println("Creating Gl-sca Report: ", targetFile) - glScaResult := &wrappers.GlScaResultsCollection{} + glScaResult := &wrappers.GlScaResultsCollection{ + Vulnerabilities: []wrappers.GlScaDepVulnerabilities{}, // Ensure this is an array + ScaDependencyFiles: []wrappers.ScaDependencyFile{}, // Ensure this is an array + } err := addScanToGlScaReport(summary, glScaResult) if err != nil { return errors.Wrapf(err, "%s: failed to denerate GL-Sca report ", failedListingResults)