diff options
author | Justin Chadwell <me@jedevc.com> | 2022-12-05 12:15:15 +0000 |
---|---|---|
committer | Justin Chadwell <me@jedevc.com> | 2022-12-05 12:15:15 +0000 |
commit | 6fe9d226281a9ea9947f44aa6e03fe9c589a8a42 (patch) | |
tree | 6ca2cccf32b36381ac1de45236c37d2ef1a7b4cc | |
parent | 452903873695a5a58db4e61e41ffa5c5463f2334 (diff) | |
download | spdx-tools-6fe9d226281a9ea9947f44aa6e03fe9c589a8a42.tar.gz |
json: sync exported struct tags across spdx versions
Signed-off-by: Justin Chadwell <me@jedevc.com>
-rw-r--r-- | spdx/v2_1/document.go | 12 | ||||
-rw-r--r-- | spdx/v2_1/file.go | 2 | ||||
-rw-r--r-- | spdx/v2_1/package.go | 2 | ||||
-rw-r--r-- | spdx/v2_2/document.go | 12 | ||||
-rw-r--r-- | spdx/v2_2/package.go | 6 |
5 files changed, 17 insertions, 17 deletions
diff --git a/spdx/v2_1/document.go b/spdx/v2_1/document.go index 21533a0..81738ff 100644 --- a/spdx/v2_1/document.go +++ b/spdx/v2_1/document.go @@ -53,12 +53,12 @@ type Document struct { DocumentComment string `json:"comment,omitempty"` CreationInfo *CreationInfo `json:"creationInfo"` - Packages []*Package `json:"packages"` - Files []*File `json:"files"` - OtherLicenses []*OtherLicense `json:"hasExtractedLicensingInfos"` - Relationships []*Relationship `json:"relationships"` - Annotations []*Annotation `json:"annotations"` - Snippets []Snippet `json:"snippets"` + Packages []*Package `json:"packages,omitempty"` + Files []*File `json:"files,omitempty"` + OtherLicenses []*OtherLicense `json:"hasExtractedLicensingInfos,omitempty"` + Relationships []*Relationship `json:"relationships,omitempty"` + Annotations []*Annotation `json:"annotations,omitempty"` + Snippets []Snippet `json:"snippets,omitempty"` // DEPRECATED in version 2.0 of spec Reviews []*Review `json:"-"` diff --git a/spdx/v2_1/file.go b/spdx/v2_1/file.go index ffdec94..2373887 100644 --- a/spdx/v2_1/file.go +++ b/spdx/v2_1/file.go @@ -66,7 +66,7 @@ type File struct { // defined here -- so this should just be an ElementID. Snippets map[common.ElementID]*Snippet `json:"-"` - Annotations []Annotation `json:"annotations"` + Annotations []Annotation `json:"annotations,omitempty"` } // ArtifactOfProject is a DEPRECATED collection of data regarding diff --git a/spdx/v2_1/package.go b/spdx/v2_1/package.go index dc61ff6..6b0d7a5 100644 --- a/spdx/v2_1/package.go +++ b/spdx/v2_1/package.go @@ -95,7 +95,7 @@ type Package struct { PackageExternalReferences []*PackageExternalReference `json:"externalRefs,omitempty"` // Files contained in this Package - Files []*File + Files []*File `json:"files,omitempty"` Annotations []Annotation `json:"annotations,omitempty"` } diff --git a/spdx/v2_2/document.go b/spdx/v2_2/document.go index b09e88f..31ac08b 100644 --- a/spdx/v2_2/document.go +++ b/spdx/v2_2/document.go @@ -53,12 +53,12 @@ type Document struct { DocumentComment string `json:"comment,omitempty"` CreationInfo *CreationInfo `json:"creationInfo"` - Packages []*Package `json:"packages"` - Files []*File `json:"files"` - OtherLicenses []*OtherLicense `json:"hasExtractedLicensingInfos"` - Relationships []*Relationship `json:"relationships"` - Annotations []*Annotation `json:"annotations"` - Snippets []Snippet `json:"snippets"` + Packages []*Package `json:"packages,omitempty"` + Files []*File `json:"files,omitempty"` + OtherLicenses []*OtherLicense `json:"hasExtractedLicensingInfos,omitempty"` + Relationships []*Relationship `json:"relationships,omitempty"` + Annotations []*Annotation `json:"annotations,omitempty"` + Snippets []Snippet `json:"snippets,omitempty"` // DEPRECATED in version 2.0 of spec Reviews []*Review `json:"-"` diff --git a/spdx/v2_2/package.go b/spdx/v2_2/package.go index 164dfd2..77d9c08 100644 --- a/spdx/v2_2/package.go +++ b/spdx/v2_2/package.go @@ -52,7 +52,7 @@ type Package struct { // 7.10: Package Checksum: may have keys for SHA1, SHA256 and/or MD5 // Cardinality: optional, one or many - PackageChecksums []common.Checksum `json:"checksums"` + PackageChecksums []common.Checksum `json:"checksums,omitempty"` // 7.11: Package Home Page // Cardinality: optional, one @@ -108,9 +108,9 @@ type Package struct { PackageAttributionTexts []string `json:"attributionTexts,omitempty"` // Files contained in this Package - Files []*File + Files []*File `json:"files,omitempty"` - Annotations []Annotation `json:"annotations"` + Annotations []Annotation `json:"annotations,omitempty"` } // PackageExternalReference is an External Reference to additional info |