@@ -181,12 +181,18 @@ func createEmptySarifReport() []byte {
181181 return sarifData
182182}
183183
184+ type SimpleSarifReport struct {
185+ Version string `json:"version"`
186+ Schema string `json:"$schema"`
187+ Runs []json.RawMessage `json:"runs"`
188+ }
189+
184190// MergeSarifOutputs combines multiple SARIF files into a single output file
185191func MergeSarifOutputs (inputFiles []string , outputFile string ) error {
186- var mergedSarif SarifReport
192+ var mergedSarif SimpleSarifReport
187193 mergedSarif .Version = "2.1.0"
188194 mergedSarif .Schema = "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json"
189- mergedSarif .Runs = make ([]Run , 0 )
195+ mergedSarif .Runs = make ([]json. RawMessage , 0 )
190196
191197 for _ , file := range inputFiles {
192198 data , err := os .ReadFile (file )
@@ -198,7 +204,7 @@ func MergeSarifOutputs(inputFiles []string, outputFile string) error {
198204 return fmt .Errorf ("failed to read SARIF file %s: %w" , file , err )
199205 }
200206
201- var sarif SarifReport
207+ var sarif SimpleSarifReport
202208 if err := json .Unmarshal (data , & sarif ); err != nil {
203209 return fmt .Errorf ("failed to parse SARIF file %s: %w" , file , err )
204210 }
0 commit comments