Skip to content

Commit 15b95f4

Browse files
authored
chore(types): deprecate Vulnerability.Severity field (#672)
1 parent 31450c7 commit 15b95f4

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

pkg/types/types.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,16 @@ type Advisories struct {
181181
}
182182

183183
type Vulnerability struct {
184-
Title string `json:",omitempty"`
185-
Description string `json:",omitempty"`
186-
Severity string `json:",omitempty"` // Selected from VendorSeverity, depending on a scan target
184+
Title string `json:",omitempty"`
185+
Description string `json:",omitempty"`
186+
187+
// Severity is the severity selected from VendorSeverity, depending on a scan target.
188+
//
189+
// Deprecated: Use VendorSeverity instead of Severity.
190+
// Severity isn't related to a SourceID, so consumers can't tell the source of this severity.
191+
// Kept for backward compatibility and will be removed at the next schema bump (Trivy DB v3).
192+
Severity string `json:",omitempty"`
193+
187194
CweIDs []string `json:",omitempty"` // e.g. CWE-78, CWE-89
188195
VendorSeverity VendorSeverity `json:",omitempty"`
189196
CVSS VendorCVSS `json:",omitempty"`

0 commit comments

Comments
 (0)