Open mrutkows opened 6 months ago
See issue https://github.com/CycloneDX/sbom-utility/issues/91
for a similar problem...
Note: we need to create a custom marshaler as had to done with "Tools" like below:
// v1.5 allows tools to be either an array of (legacy) tool object or a new tool object
// TODO: author test for legacy (array) object vs. new tool object
if IsInterfaceASlice(value.Tools) {
arrayTools, ok := value.Tools.([]CDXLegacyCreationTool)
if ok && len(arrayTools) > 0 {
temp["tools"] = arrayTools
}
} else {
tools, ok := value.Tools.(CDXCreationTools)
if ok {
temp["tools"] = tools
}
}
TODO: figure out how to support both the v1.5 "Identity" type (a singleton of an anonymous type) vs. the v1.6 "identity" which is an array of named type (i.e., componentIdentityEvidence):
where these struct types would be referenced: