From ff719b64835af6e75dcfd6e7ff90d070f271ae07 Mon Sep 17 00:00:00 2001 From: chenk Date: Sun, 25 Jun 2023 12:19:25 +0300 Subject: [PATCH] fix: unmarshal bom on v1.5 return invalid specification version Signed-off-by: chenk --- cyclonedx_json.go | 2 ++ cyclonedx_xml.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cyclonedx_json.go b/cyclonedx_json.go index 4e3dd94..f5cc251 100644 --- a/cyclonedx_json.go +++ b/cyclonedx_json.go @@ -43,6 +43,8 @@ func (sv *SpecVersion) UnmarshalJSON(bytes []byte) error { *sv = SpecVersion1_3 case SpecVersion1_4.String(): *sv = SpecVersion1_4 + case SpecVersion1_5.String(): + *sv = SpecVersion1_5 default: return ErrInvalidSpecVersion } diff --git a/cyclonedx_xml.go b/cyclonedx_xml.go index 77337ee..4e038f2 100644 --- a/cyclonedx_xml.go +++ b/cyclonedx_xml.go @@ -183,6 +183,8 @@ func (sv *SpecVersion) UnmarshalXML(d *xml.Decoder, start xml.StartElement) erro *sv = SpecVersion1_3 case SpecVersion1_4.String(): *sv = SpecVersion1_4 + case SpecVersion1_5.String(): + *sv = SpecVersion1_5 default: return ErrInvalidSpecVersion }