mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
feat: detect when full license text has been provided and preserve as separate field (#3450)
* feat: add full text field to syft license struct --------- Signed-off-by: Christopher Angelo Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
@@ -47,6 +47,7 @@ type licenses []License
|
||||
|
||||
type License struct {
|
||||
Value string `json:"value"`
|
||||
FullText string `json:"fullText"`
|
||||
SPDXExpression string `json:"spdxExpression"`
|
||||
Type license.Type `json:"type"`
|
||||
URLs []string `json:"urls"`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifacts": [
|
||||
{
|
||||
"id": "5a2b1ae000fcb51e",
|
||||
"id": "cf21bacaa74c8c08",
|
||||
"name": "package-1",
|
||||
"version": "1.0.1",
|
||||
"type": "python",
|
||||
@@ -15,6 +15,7 @@
|
||||
"licenses": [
|
||||
{
|
||||
"value": "MIT",
|
||||
"fullText": "",
|
||||
"spdxExpression": "MIT",
|
||||
"type": "declared",
|
||||
"urls": [],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifacts": [
|
||||
{
|
||||
"id": "ad3ecac55fe1c30f",
|
||||
"id": "783177db0211edb6",
|
||||
"name": "package-1",
|
||||
"version": "1.0.1",
|
||||
"type": "python",
|
||||
@@ -15,6 +15,7 @@
|
||||
"licenses": [
|
||||
{
|
||||
"value": "MIT",
|
||||
"fullText": "",
|
||||
"spdxExpression": "MIT",
|
||||
"type": "declared",
|
||||
"urls": [],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"artifacts": [
|
||||
{
|
||||
"id": "c5cf7ac34cbca450",
|
||||
"id": "2d8996d6f81313df",
|
||||
"name": "package-1",
|
||||
"version": "1.0.1",
|
||||
"type": "python",
|
||||
@@ -16,6 +16,7 @@
|
||||
"licenses": [
|
||||
{
|
||||
"value": "MIT",
|
||||
"fullText": "",
|
||||
"spdxExpression": "MIT",
|
||||
"type": "declared",
|
||||
"urls": [],
|
||||
|
||||
@@ -230,6 +230,7 @@ func toLicenseModel(pkgLicenses []pkg.License) (modelLicenses []model.License) {
|
||||
|
||||
modelLicenses = append(modelLicenses, model.License{
|
||||
Value: l.Value,
|
||||
FullText: l.FullText,
|
||||
SPDXExpression: l.SPDXExpression,
|
||||
Type: l.Type,
|
||||
URLs: urls,
|
||||
|
||||
Reference in New Issue
Block a user