Mastercard / terraform-provider-restapi

A terraform provider to manage objects in a RESTful API
Other
785 stars 215 forks source link

Incorrect License Display in GitHub REST API #238

Open EhrichPeter opened 9 months ago

EhrichPeter commented 9 months ago

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.