diff --git a/syft/formats/syftjson/format.go b/syft/formats/syftjson/format.go index c595699b7..3c22344da 100644 --- a/syft/formats/syftjson/format.go +++ b/syft/formats/syftjson/format.go @@ -4,7 +4,7 @@ import ( "github.com/anchore/syft/syft/sbom" ) -const ID sbom.FormatID = "syft-3-json" +const ID sbom.FormatID = "syft-4-json" func Format() sbom.Format { return sbom.NewFormat( diff --git a/syft/formats/syftjson/to_format_model_test.go b/syft/formats/syftjson/to_format_model_test.go index 500f9983c..e44db8e77 100644 --- a/syft/formats/syftjson/to_format_model_test.go +++ b/syft/formats/syftjson/to_format_model_test.go @@ -1,16 +1,24 @@ package syftjson import ( + "strings" "testing" "github.com/scylladb/go-set/strset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/anchore/syft/internal" "github.com/anchore/syft/syft/formats/syftjson/model" "github.com/anchore/syft/syft/source" ) +func Test_SyftJsonID_Compatibility(t *testing.T) { + jsonMajorVersion := strings.Split(internal.JSONSchemaVersion, ".")[0] + syftJsonIDVersion := strings.Split(string(ID), "-")[1] + assert.Equal(t, jsonMajorVersion, syftJsonIDVersion) +} + func Test_toSourceModel(t *testing.T) { allSchemes := strset.New() for _, s := range source.AllSchemes {