spdx / tools-golang

Collection of Go packages to work with SPDX files
Other
121 stars 56 forks source link

package.PrimaryPackagePurpose should be []string #227

Closed puerco closed 11 months ago

puerco commented 11 months ago

The field to capture the PrimaryPurpose of packages should be a list of strings instead of a single string as it has a cardinality of many.

It is even een noted in the comments:

https://github.com/spdx/tools-golang/blob/7f95b018c0437e5dc27b4174d8fb14b0fb4decf1/spdx/v2/v2_3/package.go#L117-L120

Since this is a breaking change I wonder what would be the best way to fix it 🤔

goneall commented 11 months ago

@puerco - I think this was an error in the spec - I believe the cardinality should be 0..1 not 0..*

goneall commented 11 months ago

Reference: https://github.com/spdx/spdx-spec/issues/794 https://github.com/spdx/spdx-spec/pull/797

puerco commented 11 months ago

Ooh I just noticed, it was weird to find out the 0..many cardinality, I think I've written more than one tool that accepts it.

I saw that Keith already fixed the spec for a future release, do you think we should correct the 2.3 published spec too?

(I'll close this issue)