Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions schema/bom-1.7.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,20 @@
"$ref": "#/definitions/signature",
"title": "Signature",
"description": "Enveloped signature in [JSON Signature Format (JSF)](https://cyberphone.github.io/doc/security/jsf.html)."
},
"classifier": {
"type": "string",
"enum": [
"binary",
"sources"
],
"title": "Classifier",
"meta:enum": {
"binary": "The component can be classified as 'binary'. This is the case for most components. If a component includes both source and binary parts it is still considered 'binary'.",
"sources": "The component can be classified as 'sources'. Examples are Debian Source packages (as opposed to Debian Binary packages), or a source JAR in Java."
},
"description": "Specifies the classifier of the component. If the classifier is not specified, 'binary' SHOULD be assumed by the consumer of the BOM.",
"default": "binary"
}
},
"allOf": [
Expand Down
26 changes: 26 additions & 0 deletions schema/bom-1.7.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,14 @@ limitations under the License.
</xs:annotation>
</xs:element>
<xs:element name="tags" type="bom:tagsType" minOccurs="0" maxOccurs="1" />
<xs:element name="classifier" type="bom:classifier" minOccurs="0" maxOccurs="1" default="binary">
<xs:annotation>
<xs:documentation>
Specifies the classifier of the component. If the classifier is not specified, 'binary' SHOULD
be assumed by the consumer of the BOM.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
Expand Down Expand Up @@ -1262,6 +1270,24 @@ limitations under the License.
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="classifier">
<xs:restriction base="xs:string">
<xs:enumeration value="binary">
<xs:annotation>
<xs:documentation>The component can be classified as 'binary'. This is the case for most
components. If a component includes both source and binary parts it is still considered
'binary'.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="sources">
<xs:annotation>
<xs:documentation>The component can be classified as 'sources'. Examples are Debian Source
packages (as opposed to Debian Binary packages), or a source JAR in Java.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="classification">
<xs:restriction base="xs:string">
<xs:enumeration value="application">
Expand Down
17 changes: 17 additions & 0 deletions tools/src/test/resources/1.7/valid-classifier-1.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://cyclonedx.org/schema/bom-1.7.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.7",
"serialNumber": "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79",
"version": 1,
"components": [
{
"bom-ref": "pkg:deb/debian/curl@7.50.3-1?arch=source&distro=jessie",
"type": "application",
"classifier": "sources",
"name": "curl",
"version": "7.50.3-1",
"purl": "pkg:deb/debian/curl@7.50.3-1?arch=source&distro=jessie"
}
]
}
13 changes: 13 additions & 0 deletions tools/src/test/resources/1.7/valid-classifier-1.7.textproto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# proto-file: schema/bom-1.7.proto
# proto-message: Bom

spec_version: "1.7"
version: 1
serial_number: "urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79"
components {
type: CLASSIFICATION_APPLICATION
name: "curl"
classifier: "sources"
version: "7.50.3-1"
purl: "pkg:deb/debian/curl@7.50.3-1?arch=source&distro=jessie"
}