spdx / spdx-java-tagvalue-store

SPDX Document Storage using the Tag/Value format
Apache License 2.0
2 stars 1 forks source link

Relationship comment deleted when converting json file to tag-value #44

Closed meretp closed 1 year ago

meretp commented 1 year ago

When converting the following json file

{
  "SPDXID" : "SPDXRef-DOCUMENT",
  "spdxVersion" : "SPDX-2.3",
  "creationInfo" : {
    "created" : "2022-01-01T00:00:00Z",
    "creators" : [ "Tool: test-tool" ]
  },
  "name" : "document name",
  "dataLicense" : "CC0-1.0",
  "documentDescribes" : [ "SPDXRef-fileA"],
  "documentNamespace" : "https://some.namespace",
  "files" : [  {
    "SPDXID" : "SPDXRef-fileA",
    "checksums" : [ {
      "algorithm" : "SHA1",
      "checksumValue" : "d6a770ba38583ed4bb4525bd96e50461655d2758"
    } ],
    "fileName" : "./fileA.c"
  } ],
  "relationships" : [ {
    "spdxElementId" : "SPDXRef-fileA",
    "relationshipType" : "DESCRIBED_BY",
    "relatedSpdxElement" : "SPDXRef-DOCUMENT",
    "comment" : "comment on DESCRIBED_BY"
  } ]
}

to a tag-value file, the result is

DataLicense: CC0-1.0
DocumentNamespace: https://some.namespace
DocumentName: document name
SPDXID: SPDXRef-DOCUMENT

## Creation Information
Creator: Tool: test-tool
Created: 2022-01-01T00:00:00Z
## Relationships
Relationship: SPDXRef-DOCUMENT DESCRIBES SPDXRef-fileA

FileName: ./fileA.c
SPDXID: SPDXRef-fileA
FileChecksum: SHA1: d6a770ba38583ed4bb4525bd96e50461655d2758
LicenseConcluded: NOASSERTION
## Relationships
Relationship: SPDXRef-fileA DESCRIBED_BY SPDXRef-DOCUMENT

where the comment on the relationship SPDXRef-fileA DESCRIBED_BY SPDXRef-DOCUMENT is deleted.

goneall commented 1 year ago

Thanks @meretp for pointing this out - It will probably be a couple weeks before I can look into it, but I suspect an issue in the tag/value parser.

goneall commented 1 year ago

This was an issue in the tag/value parser - transferring issue...