Skip to content

Commit 10618e8

Browse files
committed
add BOM-Link related types
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent e22b417 commit 10618e8

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

schema/bom-1.5.schema.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@
117117
"$comment": "Identifier-DataType for interlinked elements.",
118118
"type": "string"
119119
},
120+
"bomLinkDocumentType": {
121+
"title": "BOM-Link document",
122+
"description": "Descriptor for another BOM document. See https://cyclonedx.org/capabilities/bomlink/",
123+
"type": "string",
124+
"pattern": "^urn:cdx:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[1-9][0-9]*$",
125+
"$comment": "part of the pattern is based on `bom.serialNumber`'s pattern"
126+
},
127+
"bomLinkElementType": {
128+
"title": "BOM-Link element",
129+
"description": "Descriptor for an element in another BOM document. See https://cyclonedx.org/capabilities/bomlink/",
130+
"type": "string",
131+
"pattern": "^urn:cdx:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/[1-9][0-9]*#.+$",
132+
"$comment": "part of the pattern is based on `bom.serialNumber`'s pattern"
133+
},
134+
"bomLink": {
135+
"anyOf": [
136+
{"$ref": "#/definitions/bomLinkDocumentType"},
137+
{"$ref": "#/definitions/bomLinkElementType"}
138+
]
139+
},
120140
"metadata": {
121141
"type": "object",
122142
"title": "BOM Metadata Object",

schema/bom-1.5.xsd

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,34 @@ limitations under the License.
4242
<xs:restriction base="xs:string" />
4343
</xs:simpleType>
4444

45+
<xs:simpleType name="bomLinkDocumentType">
46+
<xs:annotation>
47+
<xs:documentation xml:lang="en">
48+
Descriptor for another BOM document.
49+
See https://cyclonedx.org/capabilities/bomlink/
50+
</xs:documentation>
51+
</xs:annotation>
52+
<xs:restriction base="xs:string">
53+
<!-- part of the pattern is based on `bom.serialNumber`'s pattern -->
54+
<xs:pattern value="urn:cdx:([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\})/[1-9][0-9]*"/>
55+
</xs:restriction>
56+
</xs:simpleType>
57+
<xs:simpleType name="bomLinkElementType">
58+
<xs:annotation>
59+
<xs:documentation xml:lang="en">
60+
Descriptor for an element in another BOM document.
61+
See https://cyclonedx.org/capabilities/bomlink/
62+
</xs:documentation>
63+
</xs:annotation>
64+
<xs:restriction base="xs:string">
65+
<!-- part of the pattern is based on `bom.serialNumber`'s pattern -->
66+
<xs:pattern value="urn:cdx:([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\})/[1-9][0-9]*#.+"/>
67+
</xs:restriction>
68+
</xs:simpleType>
69+
<xs:simpleType name="bomLinkType">
70+
<xs:union memberTypes="bom:bomLinkDocumentType bom:bomLinkElementType"/>
71+
</xs:simpleType>
72+
4573
<xs:complexType name="metadata">
4674
<xs:sequence minOccurs="0" maxOccurs="1">
4775
<xs:element name="timestamp" type="xs:dateTime" minOccurs="0">

0 commit comments

Comments
 (0)