spdx / Spdx-Java-Library

Java library which implements the Java object model for SPDX and provides useful helper functions
Apache License 2.0
32 stars 33 forks source link

Relationship why not have 'spdxElementId' field? #190

Closed lunbin closed 10 months ago

lunbin commented 10 months ago

in my spdx json file, my relationships like this:


"relationships" : [ {
      "spdxElementId" : "SPDXRef-DOCUMENT",
      "relatedSpdxElement" : "SPDXRef-Package",
      "relationshipType" : "CONTAINS"
    }
]

after deserialize to spdxDocument,, when i got one relationship, i can not get spdxElementId, when i call getId function, return the relationship id, not SPDXRef-DOCUMENT

please help me. thank you!

lunbin commented 10 months ago

@pmonks @goneall @zvr @hboutemy

goneall commented 10 months ago

@lunbin - The element ID is the ID of the relatedSpdxElement, so you can get the related element ID by calling getRelatedSpdxElement().get().getId().