Skip to content

Commit 46ff114

Browse files
fix #288 (#292)
proposed fix for #288 and regression tests in contrast to #289
2 parents abc03a5 + fe7512f commit 46ff114

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

schema/bom-1.6.xsd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,12 @@ limitations under the License.
690690
<xs:complexType name="licenseType">
691691
<xs:sequence>
692692
<xs:choice>
693-
<xs:element name="id" type="spdx:licenseId" minOccurs="0" maxOccurs="1">
693+
<xs:element name="id" type="spdx:licenseId" minOccurs="1" maxOccurs="1">
694694
<xs:annotation>
695695
<xs:documentation>A valid SPDX license ID</xs:documentation>
696696
</xs:annotation>
697697
</xs:element>
698-
<xs:element name="name" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
698+
<xs:element name="name" type="xs:normalizedString" minOccurs="1" maxOccurs="1">
699699
<xs:annotation>
700700
<xs:documentation>If SPDX does not define the license used, this field may be used to provide the license name</xs:documentation>
701701
</xs:annotation>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"bomFormat": "CycloneDX",
3+
"specVersion": "1.6",
4+
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
5+
"version": 1,
6+
"components": [
7+
{
8+
"name": "license-with-no-id-nor-name",
9+
"version": "23",
10+
"description": "testcase for issue#288",
11+
"licenses": [
12+
{
13+
"license": {}
14+
}
15+
]
16+
}
17+
]
18+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
spec_version: "1.6"
2+
version: 1
3+
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
4+
components {
5+
type: CLASSIFICATION_LIBRARY
6+
name: "license-with-no-id-nor-name"
7+
version: "23"
8+
description: "testcase for issue#288"
9+
licenses {
10+
license {}
11+
}
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.6">
3+
<components>
4+
<component type="library">
5+
<name>license-with-no-id-nor-name</name>
6+
<version>23</version>
7+
<description>testcase for issue#288</description>
8+
<licenses>
9+
<license />
10+
</licenses>
11+
</component>
12+
</components>
13+
</bom>

0 commit comments

Comments
 (0)