You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But after i do a hierarchical merge, the properties get shifted to the wrong place in the xsd:sequence, behind the "components" element, but the XSD wants them to be in front.
<components>
<componenttype="library"bom-ref="ce.platform.jstools@15.8:@cyclonedx/cyclonedx-npm@1.7.2">
<author>Jan Kowalleck</author>
<group>@cyclonedx</group>
<name>cyclonedx-npm</name>
<version>1.7.2</version>
<description>Create CycloneDX Software Bill of Materials (SBOM) from NPM projects.</description>
<licenses>
<license>
<id>Apache-2.0</id>
</license>
</licenses>
<purl>pkg:npm/%40cyclonedx/cyclonedx-npm@1.7.2?vcs_url=git+https://github.com/CycloneDX/cyclonedx-node-npm.git</purl>
<externalReferences>
<referencetype="issue-tracker">
<url>https://github.com/CycloneDX/cyclonedx-node-npm/issues</url>
<comment>as detected from PackageJson property "bugs.url"</comment>
</reference>
<referencetype="vcs">
<url>git+https://github.com/CycloneDX/cyclonedx-node-npm.git</url>
<comment>as detected from PackageJson property "repository.url"</comment>
</reference>
<referencetype="website">
<url>https://github.com/CycloneDX/cyclonedx-node-npm#readme</url>
<comment>as detected from PackageJson property "homepage"</comment>
</reference>
</externalReferences>
<components>
...
</components>
<properties>
<propertyname="cdx:npm:package:extraneous">true</property>
<propertyname="cdx:npm:package:path">node_modules/@cyclonedx\cyclonedx-npm</property>
</properties>
</component>
This leads to a validation error later:
Validating XML BOM...
Validation failed at line number 4304 and position 12: The element 'component' in namespace 'http://cyclonedx.org/schema/bom/1.4' has invalid child element 'properties' in namespace 'http://cyclonedx.org/schema/bom/1.4'. List of possible elements expected: 'evidence, releaseNotes' in namespace 'http://cyclonedx.org/schema/bom/1.4' as well as any element in namespace '##other'.
BOM is not valid.
cyclonedx-cli version
Running on Windows 10 with the prebuilt binaries.
cyclonedx-cli --version
0.24.2
Reproduction
Try to merge the two attached files from the ZIP (one created by cyclonedx-npm, one from the example repo): property_merge.zip
cyclonedx-cli merge --hierarchical --name propexample --version 1.0 --output-file bom.xml --input-files example1.cdx.xml proton-bridge-v1.8.0.bom.xml
Processing input file example1.cdx.xml
Contains 5 components
Processing input file proton-bridge-v1.8.0.bom.xml
Contains 201 components
Writing output file...
Total 2 components
cyclonedx-cli validate --input-file bom.xml --fail-on-errors --input-version v1_4
Validating XML BOM...
Validation failed at line number 432 and position 12: The element 'component' in namespace 'http://cyclonedx.org/schema/bom/1.4' has invalid child element 'properties' in namespace 'http://cyclonedx.org/schema/bom/1.4'. List of possible elements expected: 'evidence, releaseNotes' in namespace 'http://cyclonedx.org/schema/bom/1.4' as well as any element in namespace '##other'.
BOM is not valid.
The text was updated successfully, but these errors were encountered:
Problem
I try to merge a SBOM created via https://github.com/CycloneDX/cyclonedx-node-npm to another SBOM.
The NPM SBOM contains extra properties for the toplevel components and subcomponents
e.g. it looks like this, which is valid.:
But after i do a hierarchical merge, the properties get shifted to the wrong place in the xsd:sequence, behind the "components" element, but the XSD wants them to be in front.
This leads to a validation error later:
cyclonedx-cli version
Running on Windows 10 with the prebuilt binaries.
Reproduction
Try to merge the two attached files from the ZIP (one created by cyclonedx-npm, one from the example repo):
property_merge.zip
The text was updated successfully, but these errors were encountered: