At least one 200, 201, 202, or 204 response should be defined for POST operations

Description

POST operations in your API must have at least one 200, 201, 202, or 204 response defined.

For more details, see RFC 7231.

Example

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

1post:
2  # ...
3  responses:
4    default:
5      description: Unexpected error
6      schema:
7        $ref: "#/components/schemas/Error"
8

Remediation

Define 200, 201, 202, or 204 responses for all POST operation.

1post:
2  # ...
3  responses:
4    "204":
5      description: OK
6    default:
7      description: Unexpected error
8      schema:
9        $ref: "#/components/schemas/Error"
10

Copyright 42Crunch 2021