Skip to content

Add SPDX-License-Identifier to C# file headers#1886

Merged
lahma merged 2 commits intomasterfrom
copilot/update-license-statements
Mar 1, 2026
Merged

Add SPDX-License-Identifier to C# file headers#1886
lahma merged 2 commits intomasterfrom
copilot/update-license-statements

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

License compliance tools (e.g., FOSSology) cannot resolve URL-based license references in file headers, making automated license scanning unreliable. Replacing with standard SPDX identifiers enables tooling to identify the license without network access or URL resolution.

Changes

  • Replaced // <license>https://...LICENSE.md</license> with // SPDX-License-Identifier: MIT across 148 C# source files
  • Covers files originally from NJsonSchema, NSwag, and MyToolkit — all MIT licensed by Rico Suter
  • Left .NET Foundation-originated files unchanged (already carry proper MIT attribution)

Before:

// <license>https://github.com/RicoSuter/NJsonSchema/blob/master/LICENSE.md</license>

After:

// SPDX-License-Identifier: MIT
Original prompt

This section details on the original issue you should resolve

<issue_title>Better license statement</issue_title>
<issue_description>You are creating great software, thank you very much for that.

An improvement could be a better display of the license for each file.
I am a license compliance expert working for Siemens. We scan all open source we use
to know all licenses, for example with tools like FOSSology (https://www.fossology.org/).

These tools have a hard time analyzing your file header, because they are not prepared to resolve
a URL like https://github.com/RicoSuter/NJsonSchema/blob/master/LICENSE.md.

The standard for license compliance would be an SPDX identifier like SPDX-License-Identifier: MIT,
see https://spdx.dev/ids/ for details. If you want to do a perfect job, you could also have a look at
https://reuse.software/.

I have my own OSS projects, so I know that updating each file costs some effort ... but it would make
your projects a little be mote perfect and better to use.</issue_description>

Comments on the Issue (you are @copilot in this section)

@RicoSuter Can you propose a header to be added in each C# file? Why are you even scanning source code files and not just use the license of the pkg?

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Improve license display for better compliance Add SPDX-License-Identifier to C# file headers Mar 1, 2026
Copilot finished work on behalf of lahma March 1, 2026 19:57
@lahma lahma marked this pull request as ready for review March 1, 2026 20:03
@lahma lahma merged commit 667e297 into master Mar 1, 2026
2 checks passed
@lahma lahma deleted the copilot/update-license-statements branch March 1, 2026 20:16
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.

Better license statement

2 participants