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

Fix special IDs for right-side 2.2 Relationships #68

Merged
merged 4 commits into from
May 2, 2021

Conversation

swinslow
Copy link
Member

@swinslow swinslow commented May 2, 2021

Fixes #59

Signed-off-by: Steve Winslow steve@swinslow.net

In SPDX 2.2, the right-hand side of Relationships are not limited
to SPDX IDs; they can also include the special values NONE and
NOASSERTION.

To handle these, since Golang doesn't (to my knowledge) have a
concept of union types, and since I don't want to use interface{},
this commit instead adds a new SpecialID field to DocElementID.
When SpecialID is non-empty, it should be treated as being a
"special" ID value, and DocumentRefID / ElementRefID should be
ignored.

(Unfortunately, we can't just use ElementRefID == "NONE", etc.
for this purpose, because in theory an SPDX document could define
the identifier SPDXRef-NONE to mean something. Even though they
really, really shouldn't do that.)

This commit updates tvloader and tvsaver to appropriately handle
the possibility of NONE and NOASSERTION for this field.

Signed-off-by: Steve Winslow <steve@swinslow.net>
Fix special IDs for right-side 2.2 Relationships
@swinslow
Copy link
Member Author

swinslow commented May 2, 2021

Previously merged into 0.1.1 branch; merging here into master after tests pass.

@swinslow swinslow merged commit 8e09d22 into spdx:master May 2, 2021
@swinslow swinslow deleted the issue-59-to-master branch May 2, 2021 21:42
@swinslow swinslow added this to the 0.2.0 milestone Jul 4, 2021
@swinslow swinslow self-assigned this Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relationship field in tag/value parser rejects valid values
1 participant