Skip to content
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

SPDX 2.3.0 schema conflicts with documentation for Annotations #1147

Open
mmorin-netrise opened this issue Nov 13, 2024 · 1 comment
Open
Labels
doc improvement Area where the project documentation needs improvement
Milestone

Comments

@mmorin-netrise
Copy link

mmorin-netrise commented Nov 13, 2024

Clause 12 (Annotations) Section 4 of the SPDX documentation calls for an "SPDX identifier reference field".

However, the JSON schema does not specify this field. See the snippet below:

"annotations" : {
"description" : "Provide additional information about an SpdxElement.",
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"annotationDate" : {
"description" : "Identify when the comment was made. This is to be specified according to the combined date and time in the UTC format, as specified in the ISO 8601 standard.",
"type" : "string"
},
"annotationType" : {
"description" : "Type of the annotation.",
"type" : "string",
"enum" : [ "OTHER", "REVIEW" ]
},
"annotator" : {
"description" : "This field identifies the person, organization, or tool that has commented on a file, package, snippet, or the entire document.",
"type" : "string"
},
"comment" : {
"type" : "string"
}
},
"required" : [ "annotationDate", "annotationType", "annotator", "comment" ],
"additionalProperties" : false,
"description" : "An Annotation is a comment on an SpdxItem by an agent."
}
},

It would be helpful to have SPDXREF (which is used in the SPDX Tag specification) or spdxElementId (which is used in Clause 11 (Relationships)) as a defined field in the JSON schema.

Without this field defined, it is not possible to link Annotations to an element in an SPDX 2.3.0 JSON BOM.

@bact bact added this to the 2.3.1 milestone Nov 13, 2024
@mmorin-netrise
Copy link
Author

I did just notice that the JSON schema does allow for annotations within different objects (e.g. files.annotations, packages.annotations). See the snippet below:

"packages" : {
"description" : "Packages referenced in the SPDX document",
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"SPDXID" : {
"type" : "string",
"description" : "Uniquely identify any element in an SPDX document which may be referenced by other elements."
},
"annotations" : {
"description" : "Provide additional information about an SpdxElement.",
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"annotationDate" : {
"description" : "Identify when the comment was made. This is to be specified according to the combined date and time in the UTC format, as specified in the ISO 8601 standard.",
"type" : "string"
},
"annotationType" : {
"description" : "Type of the annotation.",
"type" : "string",
"enum" : [ "OTHER", "REVIEW" ]
},
"annotator" : {
"description" : "This field identifies the person, organization, or tool that has commented on a file, package, snippet, or the entire document.",
"type" : "string"
},
"comment" : {
"type" : "string"
}
},
"required" : [ "annotationDate", "annotationType", "annotator", "comment" ],
"additionalProperties" : false,
"description" : "An Annotation is a comment on an SpdxItem by an agent."
}
},

This style feels like the best (most natural?) way to use Annotations but unfortunately, it doesn't match up with any of the documentation. For example, there is no "annotation" subsection in Clause 4 (Packages).

It also feels less "SPDX"-y and more "CycloneDX"-y but that may not really matter.

@bact bact added the doc improvement Area where the project documentation needs improvement label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc improvement Area where the project documentation needs improvement
Projects
None yet
Development

No branches or pull requests

2 participants