Skip to content

Commit

Permalink
streamline licenses: make JSON meat XML constriant
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck committed May 26, 2023
1 parent b816b76 commit 4c85896
Showing 1 changed file with 36 additions and 31 deletions.
67 changes: 36 additions & 31 deletions schema/bom-1.5.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,8 @@
"$ref": "#/definitions/organizationalEntity"
},
"licenses": {
"type": "array",
"title": "BOM License(s)",
"additionalItems": false,
"items": {"$ref": "#/definitions/licenseChoice"}
"$ref": "#/definitions/licenseChoice"
},
"properties": {
"type": "array",
Expand Down Expand Up @@ -404,9 +402,7 @@
"items": {"$ref": "#/definitions/hash"}
},
"licenses": {
"type": "array",
"additionalItems": false,
"items": {"$ref": "#/definitions/licenseChoice"},
"$ref": "#/definitions/licenseChoice",
"title": "Component License(s)"
},
"copyright": {
Expand Down Expand Up @@ -845,28 +841,41 @@
}
},
"licenseChoice": {
"type": "object",
"title": "License(s)",
"additionalProperties": false,
"properties": {
"license": {
"$ref": "#/definitions/license"
},
"expression": {
"type": "string",
"title": "SPDX License Expression",
"examples": [
"Apache-2.0 AND (MIT OR GPL-2.0-only)",
"GPL-3.0-only WITH Classpath-exception-2.0"
]
}
},
"oneOf":[
"type": "array",
"title": "License Choice",
"description": "EITHER (a list of SPDX and/or named licenses) OR (a list of one SPDX License Expression)",
"oneOf": [
{
"required": ["license"]
"description": "a list of SPDX and/or named licenses",
"items": {
"type": "object",
"required": ["license"],
"additionalProperties": false,
"properties": {
"license": {"$ref": "#/definitions/license"}
}
}
},
{
"required": ["expression"]
"description": "a list of one SPDX License Expression",
"additionalItems": false,
"minItems": 1,
"maxItems": 1,
"items": [{
"type": "object",
"required": ["expression"],
"additionalProperties": false,
"properties": {
"expression": {
"type": "string",
"title": "SPDX License Expression",
"examples": [
"Apache-2.0 AND (MIT OR GPL-2.0-only)",
"GPL-3.0-only WITH Classpath-exception-2.0"
]
}
}
}]
}
]
},
Expand Down Expand Up @@ -1216,9 +1225,7 @@
"description": "Specifies information about the data including the directional flow of data and the data classification."
},
"licenses": {
"type": "array",
"additionalItems": false,
"items": {"$ref": "#/definitions/licenseChoice"},
"$ref": "#/definitions/licenseChoice",
"title": "Component License(s)"
},
"externalReferences": {
Expand Down Expand Up @@ -1503,9 +1510,7 @@
}
},
"licenses": {
"type": "array",
"additionalItems": false,
"items": {"$ref": "#/definitions/licenseChoice"},
"$ref": "#/definitions/licenseChoice",
"title": "Component License(s)"
},
"copyright": {
Expand Down

0 comments on commit 4c85896

Please sign in to comment.