Review the OpenAPI license URL

Check that the license link identifies the correct terms document.

Description

info.license.url links to the API’s license information. Accidental spaces or incorrect paths can impede access, and a well-formed address alone does not prove that the license name and content agree.

Potential impact

Consumers may have difficulty checking the terms, requiring additional work during distribution or reuse reviews.

Remediation

Correct typos and unintended spaces and link to the actual license document. Verify that the destination agrees with license.name and the intended terms.

Examples

The examples remove an accidental space from an Apache 2.0 document URL. OpenAPI 3.0 also permits relative URLs, but an explicit address for a separate license site reduces ambiguity about the base address.

Before

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/ LICENSE-2.0.html"
    }
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "description": "200 response",
            "content": {
              "application/json": {
                "examples": {
                  "foo": {
                    "value": {
                      "versions": [
                        {
                          "status": "CURRENT",
                          "updated": "2011-01-21T11:33:21Z",
                          "id": "v2.0",
                          "links": [
                            {
                              "href": "http://127.0.0.1:8774/v2/",
                              "rel": "self"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

After

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "paths": {
    "/": {
      "get": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "description": "200 response",
            "content": {
              "application/json": {
                "examples": {
                  "foo": {
                    "value": {
                      "versions": [
                        {
                          "status": "CURRENT",
                          "updated": "2011-01-21T11:33:21Z",
                          "id": "v2.0",
                          "links": [
                            {
                              "href": "http://127.0.0.1:8774/v2/",
                              "rel": "self"
                            }
                          ]
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

The revision uses the correct LICENSE-2.0.html path. Correcting a documentation link does not itself change the API’s licensing terms.

References