SamuraiAku / SPDX.jl

Provides for the creation, reading and writing of SPDX files in multiple file formats. Written in pure Julia.
MIT License
5 stars 1 forks source link

JSON document write fails if there are no relationships #11

Closed SamuraiAku closed 1 year ago

SamuraiAku commented 2 years ago
julia> testdoc= SpdxDocumentV2()
Version:                SPDX-2.2
DataLicense:            CC0-1.0
SPDXID:         SPDXRef-DOCUMENT
CreationInfo:

julia> writespdx(testdoc, "testdoc.spdx.json")
ERROR: KeyError: key "relationships" not found
Stacktrace:

But writing a TagValue file does not have this problem.

Workaround is to make sure there is a relationship present:

push!(testdoc.Relationships, SpdxRelationshipV2("A DESCRIBES B"))
julia> writespdx(testdoc, "testdoc.spdx.json")
SamuraiAku commented 1 year ago

Resolved in ef89c30