mirror of
https://github.com/anchore/syft.git
synced 2026-11-04 00:16:38 +01:00
feat: Allow specific versions of formats to be specified (#1543)
This commit is contained in:
@@ -4,14 +4,30 @@ import (
|
||||
"github.com/anchore/syft/syft/sbom"
|
||||
)
|
||||
|
||||
const ID sbom.FormatID = "spdx-2-json"
|
||||
const ID sbom.FormatID = "spdx-json"
|
||||
|
||||
var IDs = []sbom.FormatID{ID}
|
||||
|
||||
// note: this format is LOSSY relative to the syftjson format
|
||||
func Format() sbom.Format {
|
||||
|
||||
func Format2_2() sbom.Format {
|
||||
return sbom.NewFormat(
|
||||
ID,
|
||||
encoder,
|
||||
"2.2",
|
||||
encoder2_2,
|
||||
decoder,
|
||||
validator,
|
||||
IDs...,
|
||||
)
|
||||
}
|
||||
|
||||
func Format2_3() sbom.Format {
|
||||
return sbom.NewFormat(
|
||||
"2.3",
|
||||
encoder2_3,
|
||||
decoder,
|
||||
validator,
|
||||
IDs...,
|
||||
)
|
||||
}
|
||||
|
||||
var Format = Format2_3
|
||||
|
||||
Reference in New Issue
Block a user