mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 15:06:36 +01:00
Update Syft formats for SyftJson (#752)
* Update Syft formats for SyftJson This change will introduce omitempty struct tag to PackageCustomData. This struct tag will cause null and empty values to be dropped on serialization for consumers downstream. Signed-off-by: Toure Dunnon <toure.dunnon@anchore.com> * Updated the golden files for syftjson to allow for proper test coverage. Signed-off-by: Toure Dunnon <toure.dunnon@anchore.com>
This commit is contained in:
@@ -32,8 +32,8 @@ type PackageBasicData struct {
|
||||
|
||||
// PackageCustomData contains ambiguous values (type-wise) from pkg.Package.
|
||||
type PackageCustomData struct {
|
||||
MetadataType pkg.MetadataType `json:"metadataType"`
|
||||
Metadata interface{} `json:"metadata"`
|
||||
MetadataType pkg.MetadataType `json:"metadataType,omitempty"`
|
||||
Metadata interface{} `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
// packageMetadataUnpacker is all values needed from Package to disambiguate ambiguous fields during json unmarshaling.
|
||||
|
||||
Reference in New Issue
Block a user