-
-
Notifications
You must be signed in to change notification settings - Fork 293
Description
Describe the bug
The code below works fine with @tsed/* version of 8.6.0 but has problems after migration to version 8.7.0 and @tsed/platform-multer
To Reproduce
- create a controller like this
import {Controller} from '@tsed/di';
import {MultipartFile, type PlatformMulterFile} from '@tsed/platform-multer';
import {Description, Post, Returns} from '@tsed/schema';
@Controller('/api/1.0')
export class MyController {
@Returns(201)
@Post('/test')
@Description('Upload files')
public async uploadFiles(@MultipartFile('file1') file1: PlatformMulterFile, @MultipartFile('file2') file2: PlatformMulterFile): Promise<void> {
// some logic here
}
}- try to call this API from Postman or unit test
- The error will thrown:
Error: Unexpected end of form
at Multipart._final (/Users/Work/Projects/test/node_modules/busboy/lib/types/multipart.js:588:17)
at prefinish (node:internal/streams/writable:916:14)
at finishMaybe (node:internal/streams/writable:930:5)
at Multipart.Writable.end (node:internal/streams/writable:845:5)
at onend (node:internal/streams/readable:948:10)
at processTicksAndRejections (node:internal/process/task_queues:85:11) {
storageErrors: []
}Expected behavior
The server should process 2 files without any error
OS
MacOS
Node version
Node 22.14.0
Library version
8.7.0
Additional context
If the code above will be changed to
public async uploadFiles(@MultipartFile('files') files: PlatformMulterFile[]): Promise<void> {
// some logic here
}Everything will work fine. But this is not acceptable for my API.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
Done