@@ -35,15 +35,15 @@ type SarifRule struct {
3535 ShortDescription SarifMultiformatMessageString `json:"shortDescription,omitempty"`
3636 FullDescription SarifMultiformatMessageString `json:"fullDescription,omitempty"`
3737 Help SarifMultiformatMessageString `json:"help,omitempty"`
38- Properties map [string ]interface {} `json:"properties,omitempty"`
38+ Properties map [string ]any `json:"properties,omitempty"`
3939}
4040
4141type SarifResult struct {
42- RuleID string `json:"ruleId"`
43- Level string `json:"level,omitempty"` // "error", "warning", "note", "none"
44- Message SarifMessage `json:"message"`
45- Locations []SarifLocation `json:"locations,omitempty"`
46- Properties map [string ]interface {} `json:"properties,omitempty"`
42+ RuleID string `json:"ruleId"`
43+ Level string `json:"level,omitempty"` // "error", "warning", "note", "none"
44+ Message SarifMessage `json:"message"`
45+ Locations []SarifLocation `json:"locations,omitempty"`
46+ Properties map [string ]any `json:"properties,omitempty"`
4747}
4848
4949type SarifMessage struct {
@@ -178,7 +178,8 @@ func ConvertToSARIF(analysis *api.SecurityAnalysis) (string, error) {
178178 },
179179 },
180180 },
181- Properties : map [string ]interface {}{
181+ Properties : map [string ]any {
182+ "type" : "code" ,
182183 "line_number" : mitigation .LineNumber ,
183184 },
184185 }
@@ -193,7 +194,7 @@ func ConvertToSARIF(analysis *api.SecurityAnalysis) (string, error) {
193194 Message : SarifMessage {
194195 Text : mitigation .Content ,
195196 },
196- Properties : map [string ]interface {} {
197+ Properties : map [string ]any {
197198 "type" : "dependency" ,
198199 },
199200 }
@@ -203,7 +204,7 @@ func ConvertToSARIF(analysis *api.SecurityAnalysis) (string, error) {
203204 // Convert to JSON
204205 jsonBytes , err := json .MarshalIndent (sarifLog , "" , " " )
205206 if err != nil {
206- return "" , fmt .Errorf ("failed to marshal SARIF : %w" , err )
207+ return "" , fmt .Errorf ("failed to marshal sarif : %w" , err )
207208 }
208209
209210 return string (jsonBytes ), nil
0 commit comments