From 7f2d4a52c5173ac4030345011bfc6d0c320a2e5f Mon Sep 17 00:00:00 2001 From: James Kim Date: Wed, 25 Sep 2024 12:35:53 -0400 Subject: [PATCH 1/3] fix type from "array" to "object" Signed-off-by: James Kim --- schema/bom-1.6.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/bom-1.6.schema.json b/schema/bom-1.6.schema.json index d52d463..c49ff30 100644 --- a/schema/bom-1.6.schema.json +++ b/schema/bom-1.6.schema.json @@ -1073,7 +1073,7 @@ "title": "AI/ML Model Card" }, "data": { - "type": "array", + "type": "object", "items": {"$ref": "#/definitions/componentData"}, "title": "Data", "description": "This object SHOULD be specified for any component of type `data` and MUST NOT be specified for other component types." From 8577e07a52769c873365cf2f01a8f207beb525ed Mon Sep 17 00:00:00 2001 From: James Kim Date: Thu, 26 Sep 2024 13:28:57 -0400 Subject: [PATCH 2/3] revert schema json back to array Signed-off-by: James Kim --- schema/bom-1.6.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/bom-1.6.schema.json b/schema/bom-1.6.schema.json index c49ff30..d52d463 100644 --- a/schema/bom-1.6.schema.json +++ b/schema/bom-1.6.schema.json @@ -1073,7 +1073,7 @@ "title": "AI/ML Model Card" }, "data": { - "type": "object", + "type": "array", "items": {"$ref": "#/definitions/componentData"}, "title": "Data", "description": "This object SHOULD be specified for any component of type `data` and MUST NOT be specified for other component types." From e3b655ee5e6f55758fb8ca393a346d3abdf2eea7 Mon Sep 17 00:00:00 2001 From: James Kim Date: Thu, 26 Sep 2024 14:02:58 -0400 Subject: [PATCH 3/3] change Data's type to *[]ComponentData Signed-off-by: James Kim --- cyclonedx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyclonedx.go b/cyclonedx.go index f7f9803..cbd8507 100644 --- a/cyclonedx.go +++ b/cyclonedx.go @@ -250,7 +250,7 @@ type Component struct { Evidence *Evidence `json:"evidence,omitempty" xml:"evidence,omitempty"` ReleaseNotes *ReleaseNotes `json:"releaseNotes,omitempty" xml:"releaseNotes,omitempty"` ModelCard *MLModelCard `json:"modelCard,omitempty" xml:"modelCard,omitempty"` - Data *ComponentData `json:"data,omitempty" xml:"data,omitempty"` + Data *[]ComponentData `json:"data,omitempty" xml:"data,omitempty"` CryptoProperties *CryptoProperties `json:"cryptoProperties,omitempty" xml:"cryptoProperties,omitempty"` }