Missing OpenAPI 3.0 callback reference target

Check that callback references resolve to actual definitions.

Description

A callback describes a request the API provider may send later. In a local $ref under #/components/callbacks/, use the callback’s defined name.

Potential impact

A broken reference can leave the follow-up URL or request format undocumented, or stop client generation.

Remediation

If you rename a callback, update its references. For an external reference, check the URI and target definition. Verify that the actual request supplies any values the URL expression reads from it.

Examples

Before

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "post": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "callbacks": {
          "myEvent": {
            "$ref": "#/components/callbacks/inProgress"
          }
        }
      }
    }
  },
  "components": {
    "callbacks": {
      "onProgress": {
        "{$request.body#/onProgressUrl}": {
          "delete": {
            "responses": {
              "204": {
                "description": "Deleted"
              }
            }
          }
        }
      }
    }
  }
}

After

json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Simple API Overview",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "post": {
        "operationId": "listVersionsv2",
        "summary": "List API versions",
        "responses": {
          "200": {
            "description": "Success"
          }
        },
        "callbacks": {
          "myEvent": {
            "$ref": "#/components/callbacks/inProgress"
          }
        }
      }
    }
  },
  "components": {
    "callbacks": {
      "inProgress": {
        "{$request.body#/inProgressUrl}": {
          "delete": {
            "responses": {
              "204": {
                "description": "Deleted"
              }
            }
          }
        }
      }
    }
  }
}

POST / refers to inProgress. The correction renames the callback definition from onProgress to inProgress and changes the URL field from onProgressUrl to inProgressUrl. The original request body, whose definition is omitted, must supply that field.

References