-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json/yaml/xml writer lists all packages in "documentDescribes" #242
Comments
Isn't this a duplicate of #184 ? Although this is a better description I think because it correctly points out the need to list all SPDXIDs in the documentDescribes tag, which is only mentioned in the comments of 184. |
Actually I'm starting to wonder what is the correct use of documentDescribes. In the examples directory for the spec documentDescribes seems to only include some files and packages. Only those which are directly related to the SPDX-Document object in the relationships? There are other packages and files present in the respective packages and files lists which are not listed in documentDescribes. Those seem to be children of the 'top-level packages and files. |
I just went back and looked through the spec and I didn't see a very good definition or description. Probably something that needs to be addressed. From some of the SPDX meetings I've been involved in, documentDescribes is intended to be the primary packages and/or files the document is intended to document (or describe). This gives the consumer of the SPDX document a starting point(s) for traversing the graph of relationships. In many cases documentDescribes will point to a single package as the root of a tree of relationships. Other files/packages/snippets within the documents will have some direct or indirect relationship to the described package. |
I definitely agree that there is no clear description anywhere (as is the case for all specialties of the json format). My understanding, on a working level, was that: In json (and yaml and xml), all relationships of type Do you agree with that statement, @goneall ? This is coming up in various PRs, so it would be super helpful to have at least a semi-official statement on how it should work 😅 |
Just looked at some examples in tools-java: The 2.2 json example has duplicated relationships, i.e.: The elements which are listed in @goneall Are you aware of any changes between the two versions, or is this unintentional? edit: Same pattern in the examples in spdx-spec (they may be identical) edit2: More soft evidence: When using tools-java to "convert" the 2.2 json example mentioned above into json, the
|
This was an intentional change - they were related to the discussion in this issue: spdx/spdx-spec#704 |
We discussed the following strategy for dealing with Parsing: Writing: In the weird case of a |
@nicoweidner Agree with the approach - it is unlikely we're run into relationship comments on a document describes, but if we do you are already handling the duplications on read. An alternative approach would be to add the describes relationship comment to an Annotation at the document level to preserve the comment - but I think your proposal is a better approach than using the annotations. |
Fixed with #254 |
In the current implementation all packages are written to the "documentDescribes"-Tag. According to the JSON-example, packages should be listed in a tag "packages" and "documentDescribes" should only contain the SPDXIDs from the objects that the document describes.
The text was updated successfully, but these errors were encountered: