Uploading multiple files is only available for 'multipart/*' media type
Issue ID: v3-semantic-mediatype-multiplefile
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:
{
"requestBody": {
"content": {
"application/octet-stream": {
"schema": {
"properties": {
"file": {
"type": "array",
"additionalProperties": false,
"items": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
}
}
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
.
{
"requestBody": {
"content": {
" multipart/form-data": {
"schema": {
"additionalProperties": false,
"properties": {
"file": {
"type": "array",
"items": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
}
}