Skip to content

Commit

Permalink
presenter: add xmlns for bd and v namespaces in cyclonedx output
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@anchore.com>
  • Loading branch information
Alfredo Deza committed Sep 21, 2020
1 parent 3a57218 commit 80d494b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions grype/presenter/cyclonedx/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
type Document struct {
XMLName xml.Name `xml:"bom"`
XMLNs string `xml:"xmlns,attr"`
XMLNsBd string `xml:"xmlns:bd,attr"`
XMLNsV string `xml:"xmlns:v,attr"`
Version int `xml:"version,attr"`
SerialNumber string `xml:"serialNumber,attr"`
Components []Component `xml:"components>component"`
Expand All @@ -28,6 +30,8 @@ type Document struct {
func NewDocument() Document {
return Document{
XMLNs: "http://cyclonedx.org/schema/bom/1.2",
XMLNsBd: "http://cyclonedx.org/schema/ext/bom-descriptor/1.0",
XMLNsV: "http://cyclonedx.org/schema/ext/vulnerability/1.0",
Version: 1,
SerialNumber: uuid.New().URN(),
}
Expand Down

0 comments on commit 80d494b

Please sign in to comment.