Skip to content

Non-SPDX license values are silently dropped from the published JSON-LD #46

Description

@maehr

Found while reviewing #4.

scripts/compile.ts maps an authored SPDX id to its canonical IRI, and drops anything it does not recognise with a warning only:

if (SPDX_IDS.has(resolver.license)) {
  entry.license = `https://spdx.org/licenses/${resolver.license}`;
} else {
  console.warn(`⚠ license "${resolver.license}" is not an SPDX id; omitted from output …`);
}

The build stays green, so a typo (CC-BY-4 for CC-BY-4.0) or a well-intentioned non-SPDX string silently removes the licence statement from the published record. Licence metadata dropping out unnoticed is the wrong failure mode for a registry whose whole value is machine-readable claims — and registry#9 already had to clean one round of these by hand.

Suggestion: make it a hard failure. scripts/validate-data.ts is the natural place (it already walks every compiled record and exits non-zero), or fail directly in buildResolverEntry. The spec text in specification.md §9 already tells authors what to do instead:

For licences not in the SPDX list, omit license and use the optional license_url to point at the licence text.

so the error message can just quote that.

Activity

  1. added
    standardThe published specification and schemas
    on Aug 25, 2026
  2. maehr commented on Sep 2, 2026

    @maehr
    MemberAuthor

    Fixed by #75: unmappable non-SPDX licences now fail safely instead of being silently dropped; the change is included in release PR #4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    addressed-in-v0.1.0Addressed in the v0.1.0 release (PR #4)bugSomething isn't workingstandardThe published specification and schemas

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions