-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
Hi, thanks for this wonderful tool!
Description
The API ValidateLicenses
is used to determine if any of the provided license expressions is invalid.
There's a slight issue with the casing of license expression operators in this API.
Case 1:
valid, invalidLicenses := ValidateLicenses([]string{"MIT AND APACHE-2.0"})
assert.True(valid) // works
Case 2:
valid, invalidLicenses := ValidateLicenses([]string{"MIT and APACHE-2.0"})
assert.True(valid) // doesn't work
According to the SPDX specification, "License expression operators (AND, and, OR, or, WITH and with) should be matched in a case-sensitive manner, i.e., letters must be all upper case or all lower case." Ref: https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/.
Thus, Case 2 should have been valid too.
Desired Behaviour
The API ValidateLicenses
accepts license expressions with all lowercase operators too(and, or, with).
Metadata
Metadata
Assignees
Labels
No labels