Missing parameter value definition

Specify an OpenAPI 3.0 parameter's type and representation using schema or content.

Description

A path, query, header, or cookie parameter in OpenAPI 3.0 needs a definition of the value it accepts.

Potential impact

Without one, a generated SDK may send the wrong type or format.

Remediation

Choose schema for a type and its constraints, or content for a single media type. If the parameter uses $ref, check the referenced definition.

Examples

In /user/{id}, the path parameter must be named id. The revision adds an integer schema to that parameter.

Before

json
{
  "openapi": "3.0.0",
  "paths": {
    "/user/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "ID of the API version"
        }
      ]
    }
  }
}

After

json
{
  "openapi": "3.0.0",
  "paths": {
    "/user/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "ID of the API version",
          "schema": {
            "type": "integer"
          }
        }
      ]
    }
  }
}

References