mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
feat: add fullText as optional field to syft model
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
parent
2f7bacd6bc
commit
30d6eb53ac
4 changed files with 6 additions and 2 deletions
|
@ -1,9 +1,10 @@
|
|||
package file
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/anchore/syft/internal/log"
|
||||
licensepkg "github.com/anchore/syft/syft/license"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type License struct {
|
||||
|
|
|
@ -48,6 +48,7 @@ type licenses []License
|
|||
type License struct {
|
||||
Value string `json:"value"`
|
||||
SPDXExpression string `json:"spdxExpression"`
|
||||
FullText string `json:"fullText,omitempty"`
|
||||
Type license.Type `json:"type"`
|
||||
URLs []string `json:"urls"`
|
||||
Locations []file.Location `json:"locations"`
|
||||
|
|
|
@ -225,6 +225,7 @@ func toLicenseModel(pkgLicenses []pkg.License) (modelLicenses []model.License) {
|
|||
modelLicenses = append(modelLicenses, model.License{
|
||||
Value: l.Value,
|
||||
SPDXExpression: l.SPDXExpression,
|
||||
FullText: l.FullText,
|
||||
Type: l.Type,
|
||||
URLs: urls,
|
||||
Locations: locations,
|
||||
|
|
|
@ -3,11 +3,12 @@ package ocaml
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/anchore/syft/syft/artifact"
|
||||
"github.com/anchore/syft/syft/file"
|
||||
"github.com/anchore/syft/syft/pkg"
|
||||
"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestParseOpamPackage(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue