Uploading multiple files is only available for 'multipart/*' media type

Description

The Content-Type you have defined for the media type object only allows uploading a single file. To upload multiple files, you must set Content-Type to multipart.

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 of the media type object defines an array of files, but the Content-Type does not allow uploading multiple files:

1requestBody:
2  content:
3    application/octet-stream:
4      schema:
5        properties:
6          file:
7            type: array
8            additionalProperties: false
9            items:
10              type: string
11              format: binary
12

Remediation

Make sure that if you want to enable uploading multiple files, you have set the Content-Type of the media type object to multipart.

1requestBody:
2  content:
3    " multipart/form-data":
4      schema:
5        additionalProperties: false
6        properties:
7          file:
8            type: array
9            items:
10              type: string
11              format: binary
12

Copyright 42Crunch 2021