XmlParser - unable to parse XML SBOM with evidence entries
Parsing fails with
[ERROR] CycloneIT.test:15->parseSbomXml:21 » Parse com.fasterxml.jackson.databind.exc.MismatchedInputException:
Cannot deserialize value of type `java.util.ArrayList<org.cyclonedx.model.component.evidence.Occurrence>`
from Object value (token `JsonToken.START_OBJECT`)
at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: org.cyclonedx.model.Bom["metadata"]->
org.cyclonedx.model.Component["evidence"]->org.cyclonedx.model.Evidence["occurrences"])
Reproducer:
Code is just:
@Test
void test() throws Exception {
Bom bom = parseSbomXml(new File("."), "quarkus-run-cyclonedx.xml");
}
static Bom parseSbomXml(File testDir, String sbomFileName) throws Exception {
File sbomFile = new File(testDir, "target/" + sbomFileName);
assertTrue(sbomFile.exists());
return new XmlParser().parse(sbomFile);
}
SBOM XML is generated by Quarkus cyclonedx extension (https://quarkus.io/guides/cyclonedx/) during build phase. cc @aloubyansky
XmlParser - unable to parse XML SBOM with evidence entries
Parsing fails with
Reproducer:
mvn clean verifyCode is just:
SBOM XML is generated by Quarkus cyclonedx extension (https://quarkus.io/guides/cyclonedx/) during build phase. cc @aloubyansky