Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect License Display in GitHub REST API #238

Open
EhrichPeter opened this issue Sep 27, 2023 · 0 comments
Open

Incorrect License Display in GitHub REST API #238

EhrichPeter opened this issue Sep 27, 2023 · 0 comments

Comments

@EhrichPeter
Copy link

Issue Summary

The REST API of GitHub displays incorrect license information for the MasterCard Terraform provider GitHub repository. Despite the repository displaying the correct license, i.e., Apache License 2.0, in the LICENSE file, the API shows it as "other". The improper configuration or formatting of the file might be causing this error.

Steps to Reproduce

Fetch the repository's data through GitHub's REST API using the following:

https://api.github.com/repos/Mastercard/terraform-provider-restapi/license

The response shows the license object's key, name and spdx_id as "other".

Expected Result

The license object should present the correct details in alignment to the repository's LICENSE file:

"license": {
        "key": "apache-2.0",
        "name": "Apache License 2.0",
        "spdx_id": "Apache-2.0",
        "url": "https://api.github.com/licenses/apache-2.0",
        "node_id": "MDc6TGljZW5zZTI="
}

Actual Result

The license object returns "other" for key, name and spdx_id properties, indicating that the license information is unrecognized or incorrectly configured.

"license": {
        "key": "other",
        "name": "Other",
        "spdx_id": "NOASSERTION",
        "url": null,
        "node_id": "MDc6TGljZW5zZTA="
    }

Impact

The incorrect presentation of license information by the REST API can mislead and confuse those relying on this data. Particularly, those requiring license compliance information.

Possible Solution

Ensure the correct SPDX license identifier and that the LICENSE file's format allows GitHub's correct identification and parsing. Update the LICENSE file using a official Apache Licence 2.0 Template to get easily detected by the GitHub Licence parser. Find a offical template here https://github.com/apache/.github/blob/main/LICENSE.

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

No branches or pull requests

1 participant