Review the paths published in OpenAPI

Check whether an empty paths object matches the intended audience and document the paths they need.

Description

OpenAPI 2.0 and 3.0 require a paths object. It may be empty ({}) when the audience should see no routes. Omitting it or setting it to null is invalid.

Potential impact

Readers and generated clients cannot discover routes missing from paths. Those routes may still be reachable on the server.

Remediation

List the paths, methods and responses this audience needs. Keep paths: {} if the empty view is intentional, and enforce access permissions on the server.

Examples

The example documents GET / and its 200 response. Supply info in the complete document.

Before

json
{
  "openapi": "3.0.0",
  "paths": {}
}

After

json
{
  "openapi": "3.0.0",
  "paths": {
    "/": {
      "get": {
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}

References