Skip to content

Commit e846ff0

Browse files
Merge pull request #205 from CycloneDX/licenses-streamlined
`licenseChoice` streamlined
2 parents b83a2f1 + 5d99490 commit e846ff0

File tree

1 file changed

+36
-27
lines changed

1 file changed

+36
-27
lines changed

schema/bom-1.5.schema.json

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,8 @@
231231
"$ref": "#/definitions/organizationalEntity"
232232
},
233233
"licenses": {
234-
"type": "array",
235234
"title": "BOM License(s)",
236-
"items": {"$ref": "#/definitions/licenseChoice"}
235+
"$ref": "#/definitions/licenseChoice"
237236
},
238237
"properties": {
239238
"type": "array",
@@ -435,8 +434,7 @@
435434
"items": {"$ref": "#/definitions/hash"}
436435
},
437436
"licenses": {
438-
"type": "array",
439-
"items": {"$ref": "#/definitions/licenseChoice"},
437+
"$ref": "#/definitions/licenseChoice",
440438
"title": "Component License(s)"
441439
},
442440
"copyright": {
@@ -866,28 +864,41 @@
866864
}
867865
},
868866
"licenseChoice": {
869-
"type": "object",
870-
"title": "License(s)",
871-
"additionalProperties": false,
872-
"properties": {
873-
"license": {
874-
"$ref": "#/definitions/license"
875-
},
876-
"expression": {
877-
"type": "string",
878-
"title": "SPDX License Expression",
879-
"examples": [
880-
"Apache-2.0 AND (MIT OR GPL-2.0-only)",
881-
"GPL-3.0-only WITH Classpath-exception-2.0"
882-
]
883-
}
884-
},
885-
"oneOf":[
867+
"type": "array",
868+
"title": "License Choice",
869+
"description": "EITHER (a list of SPDX and/or named licenses) OR (a list of one SPDX License Expression)",
870+
"oneOf": [
886871
{
887-
"required": ["license"]
872+
"description": "a list of SPDX and/or named licenses",
873+
"items": {
874+
"type": "object",
875+
"required": ["license"],
876+
"additionalProperties": false,
877+
"properties": {
878+
"license": {"$ref": "#/definitions/license"}
879+
}
880+
}
888881
},
889882
{
890-
"required": ["expression"]
883+
"description": "a list of one SPDX License Expression",
884+
"additionalItems": false,
885+
"minItems": 1,
886+
"maxItems": 1,
887+
"items": [{
888+
"type": "object",
889+
"required": ["expression"],
890+
"additionalProperties": false,
891+
"properties": {
892+
"expression": {
893+
"type": "string",
894+
"title": "SPDX License Expression",
895+
"examples": [
896+
"Apache-2.0 AND (MIT OR GPL-2.0-only)",
897+
"GPL-3.0-only WITH Classpath-exception-2.0"
898+
]
899+
}
900+
}
901+
}]
891902
}
892903
]
893904
},
@@ -1235,8 +1246,7 @@
12351246
"description": "Specifies information about the data including the directional flow of data and the data classification."
12361247
},
12371248
"licenses": {
1238-
"type": "array",
1239-
"items": {"$ref": "#/definitions/licenseChoice"},
1249+
"$ref": "#/definitions/licenseChoice",
12401250
"title": "Component License(s)"
12411251
},
12421252
"externalReferences": {
@@ -1512,8 +1522,7 @@
15121522
}
15131523
},
15141524
"licenses": {
1515-
"type": "array",
1516-
"items": {"$ref": "#/definitions/licenseChoice"},
1525+
"$ref": "#/definitions/licenseChoice",
15171526
"title": "Component License(s)"
15181527
},
15191528
"copyright": {

0 commit comments

Comments
 (0)