mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 18:15:42 +01:00
dont use pointer for lists of elements
This commit is contained in:
parent
c8f1361c52
commit
37cdda7c42
1 changed files with 22 additions and 20 deletions
|
|
@ -756,20 +756,20 @@ type References []*Reference
|
||||||
|
|
||||||
// Vulnerability contains all fields that are related to a single vulnerability in the document.
|
// Vulnerability contains all fields that are related to a single vulnerability in the document.
|
||||||
type Vulnerability struct {
|
type Vulnerability struct {
|
||||||
Acknowledgements *Acknowledgements `json:"acknowledgements,omitempty"`
|
Acknowledgements Acknowledgements `json:"acknowledgements,omitempty"`
|
||||||
CVE *CVE `json:"cve,omitempty"`
|
CVE *CVE `json:"cve,omitempty"`
|
||||||
CWE *CWE `json:"cwe,omitempty"`
|
CWE *CWE `json:"cwe,omitempty"`
|
||||||
DiscoveryDate *string `json:"discovery_date,omitempty"`
|
DiscoveryDate *string `json:"discovery_date,omitempty"`
|
||||||
Flags *Flags `json:"flags,omitempty"`
|
Flags Flags `json:"flags,omitempty"`
|
||||||
IDs *VulnerabilityIDs `json:"ids,omitempty"` // unique ID elements
|
IDs VulnerabilityIDs `json:"ids,omitempty"` // unique ID elements
|
||||||
Involvements *Involvements `json:"involvements,omitempty"`
|
Involvements Involvements `json:"involvements,omitempty"`
|
||||||
Notes Notes `json:"notes,omitempty"`
|
Notes Notes `json:"notes,omitempty"`
|
||||||
ProductStatus *ProductStatus `json:"product_status,omitempty"`
|
ProductStatus *ProductStatus `json:"product_status,omitempty"`
|
||||||
References References `json:"references,omitempty"`
|
References References `json:"references,omitempty"`
|
||||||
ReleaseDate *string `json:"release_date,omitempty"`
|
ReleaseDate *string `json:"release_date,omitempty"`
|
||||||
Remediations *Remediations `json:"remediations,omitempty"`
|
Remediations Remediations `json:"remediations,omitempty"`
|
||||||
Scores *Scores `json:"scores,omitempty"`
|
Scores Scores `json:"scores,omitempty"`
|
||||||
Threats *Threats `json:"threats,omitempty"`
|
Threats Threats `json:"threats,omitempty"`
|
||||||
Title *string `json:"title,omitempty"`
|
Title *string `json:"title,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -780,7 +780,7 @@ type Vulnerabilities []*Vulnerability
|
||||||
type Advisory struct {
|
type Advisory struct {
|
||||||
Document *Document `json:"document"` // required
|
Document *Document `json:"document"` // required
|
||||||
ProductTree *ProductTree `json:"product_tree,omitempty"`
|
ProductTree *ProductTree `json:"product_tree,omitempty"`
|
||||||
Vulnerabilities *Vulnerabilities `json:"vulnerabilities,omitempty"`
|
Vulnerabilities Vulnerabilities `json:"vulnerabilities,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates a AggregateSeverity.
|
// Validate validates a AggregateSeverity.
|
||||||
|
|
@ -1375,9 +1375,11 @@ func (adv *Advisory) Validate() error {
|
||||||
return fmt.Errorf("'product_tree' is invalid: %w", err)
|
return fmt.Errorf("'product_tree' is invalid: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if adv.Vulnerabilities != nil {
|
||||||
if err := adv.Vulnerabilities.Validate(); err != nil {
|
if err := adv.Vulnerabilities.Validate(); err != nil {
|
||||||
return fmt.Errorf("'vulnerabilities' is invalid: %w", err)
|
return fmt.Errorf("'vulnerabilities' is invalid: %w", err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue