Skip to content

Commit

Permalink
add BOM-Link related types
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck committed Jun 3, 2023
1 parent e22b417 commit e43040c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
20 changes: 20 additions & 0 deletions schema/bom-1.5.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@
"$comment": "Identifier-DataType for interlinked elements.",
"type": "string"
},
"bomLinkDocumentType": {
"title": "BOM-Link document",
"description": "Descriptor for another BOM document. See https://cyclonedx.org/capabilities/bomlink/",
"type": "string",
"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]*$",
"$comment": "part of the pattern is based on `bom.serialNumber`'s pattern"
},
"bomLinkElementType": {
"title": "BOM-Link element",
"description": "Descriptor for an element in another BOM document. See https://cyclonedx.org/capabilities/bomlink/",
"type": "string",
"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]*#.+$",
"$comment": "part of the pattern is based on `bom.serialNumber`'s pattern"
},
"bomLink": {
"anyOf": [
{ "$ref": "#/definitions/bomLinkDocumentType" },
{ "$ref": "#/definitions/bomLinkElementType" }
]
},
"metadata": {
"type": "object",
"title": "BOM Metadata Object",
Expand Down
30 changes: 30 additions & 0 deletions schema/bom-1.5.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,36 @@ limitations under the License.
<xs:restriction base="xs:string" />
</xs:simpleType>

<xs:simpleType name="bomLinkDocumentType">
<xs:annotation>
<xs:documentation xml:lang="en">
Descriptor for another BOM document.
See https://cyclonedx.org/capabilities/bomlink/
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<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]*">
<!-- part of the pattern is based on `bom.serialNumber`'s pattern -->
</xs:pattern>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="bomLinkElementType">
<xs:annotation>
<xs:documentation xml:lang="en">
Descriptor for an element in another BOM document.
See https://cyclonedx.org/capabilities/bomlink/
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<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]*#.+">
<!-- part of the pattern is based on `bom.serialNumber`'s pattern -->
</xs:pattern>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="bomLinkType">
<xs:union memberTypes="bom:bomLinkDocumentType bom:bomLinkElementType"/>
</xs:simpleType>

<xs:complexType name="metadata">
<xs:sequence minOccurs="0" maxOccurs="1">
<xs:element name="timestamp" type="xs:dateTime" minOccurs="0">
Expand Down

0 comments on commit e43040c

Please sign in to comment.