Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func componentConverter(specVersion SpecVersion) func(*Component) {
c.OmniborID = nil
c.Manufacturer = nil
c.Authors = nil
c.Tags = nil
}

if !specVersion.supportsComponentType(c.Type) {
Expand Down
23 changes: 23 additions & 0 deletions convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,26 @@ func Test_convertAuthors(t *testing.T) {
assert.Nil(t, (*bom.Components)[0].Authors)
})
}

func Test_convertTags(t *testing.T) {
t.Run("spec 1.5 and lower", func(t *testing.T) {
bom := NewBOM()
bom.Metadata = &Metadata{
Component: &Component{
Name: "test",
Tags: &[]string{"tag1", "tag2"},
},
}
bom.Components = &[]Component{
{
Name: "foo",
Tags: &[]string{"tag3", "tag4"},
},
}

bom.convert(SpecVersion1_5)

assert.Nil(t, bom.Metadata.Component.Tags)
assert.Nil(t, (*bom.Components)[0].Tags)
})
}
Loading