Schema does not define a required property

Description

One or more properties that you have defined as required are not defined in the schema.

For more details, see the OpenAPI Specification.

Example

The following is an example of how this issue could look in your API definition. The schema requires the property name, but it has not been defined:

1name: Pet
2in: body
3description: pet to add to the system
4required: true
5schema:
6  type: object
7  additionalProperties: "false"
8  required:
9    - name
10  properties:
11    breed:
12      type: string
13    age:
14      type: integer
15

Remediation

Make sure that all properties you have defined as required are also defined in the schema.

1name: pet
2in: body
3description: pet to add to the system
4required: true
5schema:
6  type: object
7  additionalProperties: "false"
8  required:
9    - name
10  properties:
11    name:
12      type: string
13    breed:
14      type: string
15    age:
16      type: integer
17

Copyright 42Crunch 2021