Skip to content

Commit 4c85896

Browse files
committed
streamline licenses: make JSON meat XML constriant
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent b816b76 commit 4c85896

File tree

1 file changed

+36
-31
lines changed

1 file changed

+36
-31
lines changed

schema/bom-1.5.schema.json

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,8 @@
194194
"$ref": "#/definitions/organizationalEntity"
195195
},
196196
"licenses": {
197-
"type": "array",
198197
"title": "BOM License(s)",
199-
"additionalItems": false,
200-
"items": {"$ref": "#/definitions/licenseChoice"}
198+
"$ref": "#/definitions/licenseChoice"
201199
},
202200
"properties": {
203201
"type": "array",
@@ -404,9 +402,7 @@
404402
"items": {"$ref": "#/definitions/hash"}
405403
},
406404
"licenses": {
407-
"type": "array",
408-
"additionalItems": false,
409-
"items": {"$ref": "#/definitions/licenseChoice"},
405+
"$ref": "#/definitions/licenseChoice",
410406
"title": "Component License(s)"
411407
},
412408
"copyright": {
@@ -845,28 +841,41 @@
845841
}
846842
},
847843
"licenseChoice": {
848-
"type": "object",
849-
"title": "License(s)",
850-
"additionalProperties": false,
851-
"properties": {
852-
"license": {
853-
"$ref": "#/definitions/license"
854-
},
855-
"expression": {
856-
"type": "string",
857-
"title": "SPDX License Expression",
858-
"examples": [
859-
"Apache-2.0 AND (MIT OR GPL-2.0-only)",
860-
"GPL-3.0-only WITH Classpath-exception-2.0"
861-
]
862-
}
863-
},
864-
"oneOf":[
844+
"type": "array",
845+
"title": "License Choice",
846+
"description": "EITHER (a list of SPDX and/or named licenses) OR (a list of one SPDX License Expression)",
847+
"oneOf": [
865848
{
866-
"required": ["license"]
849+
"description": "a list of SPDX and/or named licenses",
850+
"items": {
851+
"type": "object",
852+
"required": ["license"],
853+
"additionalProperties": false,
854+
"properties": {
855+
"license": {"$ref": "#/definitions/license"}
856+
}
857+
}
867858
},
868859
{
869-
"required": ["expression"]
860+
"description": "a list of one SPDX License Expression",
861+
"additionalItems": false,
862+
"minItems": 1,
863+
"maxItems": 1,
864+
"items": [{
865+
"type": "object",
866+
"required": ["expression"],
867+
"additionalProperties": false,
868+
"properties": {
869+
"expression": {
870+
"type": "string",
871+
"title": "SPDX License Expression",
872+
"examples": [
873+
"Apache-2.0 AND (MIT OR GPL-2.0-only)",
874+
"GPL-3.0-only WITH Classpath-exception-2.0"
875+
]
876+
}
877+
}
878+
}]
870879
}
871880
]
872881
},
@@ -1216,9 +1225,7 @@
12161225
"description": "Specifies information about the data including the directional flow of data and the data classification."
12171226
},
12181227
"licenses": {
1219-
"type": "array",
1220-
"additionalItems": false,
1221-
"items": {"$ref": "#/definitions/licenseChoice"},
1228+
"$ref": "#/definitions/licenseChoice",
12221229
"title": "Component License(s)"
12231230
},
12241231
"externalReferences": {
@@ -1503,9 +1510,7 @@
15031510
}
15041511
},
15051512
"licenses": {
1506-
"type": "array",
1507-
"additionalItems": false,
1508-
"items": {"$ref": "#/definitions/licenseChoice"},
1513+
"$ref": "#/definitions/licenseChoice",
15091514
"title": "Component License(s)"
15101515
},
15111516
"copyright": {

0 commit comments

Comments
 (0)