Spdx-Java-Library icon indicating copy to clipboard operation
Spdx-Java-Library copied to clipboard

Support NONE and NOASSERTION in license expressions

Open goneall opened this issue 8 months ago • 3 comments

goneall avatar Apr 11 '25 18:04 goneall

@pmonks @bact - thanks for the review and comments.

You're correct in that these are not officially part of the spec. There's a tool out there that's generating these expressions and the library creates a really bad error message.

I should probably change the code to just generate a decent error message rather than succeeding - hopefully we can add this to 3.1.

goneall avatar Apr 12 '25 16:04 goneall

It is possible that the code for 3.0 here (and its expression) will become valid, if eventually at some point NOASSERTION and NONE are added to the SPDX License List (without the need of spec amendment (3.1?)).

Alternatively, if it is not preferred to have NOASSERTION and NONE as a license-id in the SPDX License List, it maybe possible to:

  1. define "LicenseRef-NOASSERTION" and "LicenseRef-NONE" as special instances of LicenseRef, to represent NOASSERTION and NONE; or
  2. define NOASSERTION and NONE as a special token in the expression syntax

Both (1) and (2) require the spec amendment.

bact avatar Apr 12 '25 17:04 bact

Fixing the error message turned out to be problematic.

I'll switch this PR to draft mode awaiting the outcome of the discussion on license expressions.

goneall avatar Apr 14 '25 17:04 goneall