Value of the schema discriminator must be a required property

Description

The value of the discriminator property in the schema in question has not been listed as a required property. The value of the discriminator property must be a string.

For more details, see the OpenAPI Specification.

Example

The following is an example of how this issue could look in your API definition. Here, the discriminator petType is not included in the required properties:

"Pet": {
      "type": "object",
      "discriminator": "petType",
      "properties": {
        "name": {
          "type": "string"
        },
        "petType": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    }
  }
}

Remediation

Make sure that all discriminator values are listed as required properties.

"Pet": {
      "type": "object",
      "discriminator": "petType",
      "properties": {
        "name": {
          "type": "string"
        },
        "petType": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "petType"
      ]
    }
  }
}