Parameter reference does not exist (OpenAPI 2.0)

A referenced shared parameter is missing

Description

A shared parameter reference such as #/parameters/... must use a name defined in the top-level parameters map.

Potential impact

A missing definition can stop validation or leave a required input out of generated documentation.

Remediation

Fix the spelling or restore the missing definition. Remove the reference only if the API no longer uses the parameter. When renaming it, update every operation that refers to it.

Examples

The GET / example drops the undefined maxParam reference. It keeps limitParam for the required query parameter named limit.

Before

json
{
  "paths": {
    "/": {
      "get": {
        "parameters": [
          {
            "$ref": "#/parameters/maxParam"
          },
          {
            "$ref": "#/parameters/limitParam"
          }
        ]
      }
    }
  },
  "parameters": {
    "limitParam": {
      "name": "limit",
      "in": "query",
      "required": true,
      "type": "integer"
    }
  }
}

After

json
{
  "paths": {
    "/": {
      "get": {
        "parameters": [
          {
            "$ref": "#/parameters/limitParam"
          }
        ]
      }
    }
  },
  "parameters": {
    "limitParam": {
      "name": "limit",
      "in": "query",
      "required": true,
      "type": "integer"
    }
  }
}

References