add encoder tests for spdx-json and syft json

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2021-10-10 18:56:16 -07:00
parent d474281731
commit 4a82e4843a
10 changed files with 636 additions and 155 deletions
@@ -15,16 +15,16 @@ type SyftPackageData struct {
}
type SyftPackageCustomData struct {
MetadataType pkg.MetadataType `json:"metadataType"`
Metadata interface{} `json:"metadata"`
MetadataType pkg.MetadataType `json:"metadataType,omitempty"`
Metadata interface{} `json:"metadata,omitempty"`
}
type SyftPackageBasicData struct {
PackageType pkg.Type `json:"type"`
FoundBy string `json:"foundBy"`
Locations []source.Location `json:"locations"`
Licenses []string `json:"licenses"`
Language pkg.Language `json:"language"`
PackageType pkg.Type `json:"type,omitempty"`
FoundBy string `json:"foundBy,omitempty"`
Locations []source.Location `json:"locations,omitempty"`
Licenses []string `json:"licenses,omitempty"`
Language pkg.Language `json:"language,omitempty"`
}
// syftPackageMetadataUnpacker is all values needed from Package to disambiguate ambiguous fields during json unmarshaling.