Skip to content

Commit

Permalink
Merge pull request #445 from CycloneDX/fix-spec-version-validation
Browse files Browse the repository at this point in the history
fix: spec version validation
  • Loading branch information
nscuro committed Apr 6, 2024
2 parents dd5bfba + 4550c9b commit 69bfeee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cli/options/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestOutputOptions_Validate(t *testing.T) {

t.Run("InvalidOutputVersion", func(t *testing.T) {
var options OutputOptions
options.OutputVersion = "1.5"
options.OutputVersion = "1.6"

err := options.Validate()
require.Error(t, err)
Expand Down
2 changes: 2 additions & 0 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func ParseSpecVersion(specVersion string) (sv cdx.SpecVersion, err error) {
sv = cdx.SpecVersion1_3
case cdx.SpecVersion1_4.String():
sv = cdx.SpecVersion1_4
case cdx.SpecVersion1_5.String():
sv = cdx.SpecVersion1_5
default:
err = cdx.ErrInvalidSpecVersion
}
Expand Down

0 comments on commit 69bfeee

Please sign in to comment.