Skip to content

Commit

Permalink
fix: protobuf Metadata.licenses repeated (#401)
Browse files Browse the repository at this point in the history
fixes #264
  • Loading branch information
stevespringett authored Mar 23, 2024
2 parents f866a54 + d0c2c86 commit 7a9208a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion schema/bom-1.6.proto
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ message Metadata {
// The organization that supplied the component that the BOM describes. The supplier may often be the manufacture, but may also be a distributor or repackager.
optional OrganizationalEntity supplier = 6;
// The license information for the BOM document. This may be different from the license(s) of the component(s) that the BOM describes.
optional LicenseChoice licenses = 7;
repeated LicenseChoice licenses = 7;
// Specifies optional, custom, properties
repeated Property properties = 8;
// Lifecycles communicate the stage(s) in which data in the BOM was captured. Different types of data may be available at various phases of a lifecycle, such as the Software Development Lifecycle (SDLC), IT Asset Management (ITAM), and Software Asset Management (SAM). Thus, a BOM may include data specific to or only obtainable in a given lifecycle.
Expand Down
8 changes: 8 additions & 0 deletions tools/src/test/resources/1.6/valid-metadata-license-1.6.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"license": {
"id": "Apache-2.0"
}
},
{
"license": {
"name": "My License",
"text": {
"content": "My License Text"
}
}
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ metadata {
id: "Apache-2.0"
}
}
licenses {
license {
name: "My License"
text {
value: "My License Text"
}
}
}
}
10 changes: 8 additions & 2 deletions tools/src/test/resources/1.6/valid-metadata-license-1.6.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<?xml version="1.0"?>
<bom serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1" xmlns="http://cyclonedx.org/schema/bom/1.6">
<bom xmlns="http://cyclonedx.org/schema/bom/1.6"
serialNumber="urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79" version="1"
>
<metadata>
<licenses>
<license>
<id>Apache-2.0</id>
</license>
<license>
<name>My License</name>
<text>My License Text</text>
</license>
</licenses>
</metadata>
<components />
<components/>
</bom>

0 comments on commit 7a9208a

Please sign in to comment.