Body parameter must have the schema property defined

Description

The body parameter in question is missing the schema property. Body parameters must have the schema property defined.

This applies only to OpenAPI Specification (OAS) v2. For more details, see the OAS.

Example

The following is an example of how this issue could look in your API definition:

"post": {
  "description": "Creates a new pet in the store",
  "operationId": "addPet",
  "parameters": [
    {
      "name": "pet",
      "in": "body",
      "description": "pet to add to the system",
      "required": true,
    }
  ]
}

Remediation

Make sure that all body parameters have the schema property defined.

"post": {
  "description": "Creates a new pet in the store",
  "operationId": "addPet",
  "parameters": [
    {
      "name": "pet",
      "in": "body",
      "description": "pet to add to the system",
      "required": true,
      "schema": {  
        "type": "object",
        "required": [
          "name"
          ],
        "properties": {
          "name": {
          "type": "string"
          },
          ...
         }
       }
     }
   ]
}

Get API Security news directly in your Inbox.

By clicking Subscribe you agree to our Data Policy