refactor(misconf): don't remove Highlighted in json format (#5531)

This commit is contained in:
DmitriyLewen
2023-11-08 05:40:42 +06:00
committed by GitHub
parent 7712f8f216
commit a1b47441a5
4 changed files with 70 additions and 7 deletions

View File

@@ -119,13 +119,6 @@ func (r *Result) MarshalJSON() ([]byte, error) {
r.Vulnerabilities[i].VendorSeverity = nil
}
// remove the Highlighted attribute from the json results
for i := range r.Misconfigurations {
for li := range r.Misconfigurations[i].CauseMetadata.Code.Lines {
r.Misconfigurations[i].CauseMetadata.Code.Lines[li].Highlighted = ""
}
}
// Notice the Alias struct prevents MarshalJSON being called infinitely
type ResultAlias Result
return json.Marshal(&struct {