You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used the search to make sure that a similar issue hasn't already been submit
Expected Behavior
Current Behavior
In an express application I have an endpoint which expects form-data. Text fields and file fields are mixed.
Whenever I try to send a request to this endpoint I get the error in "expressTemplateService" which is shown below. This error has first shown up in version 6.1.0. Older releases of tsoa worked as expected.
As is shown below, i have a file with the name "avatar":
But to access the requestedFiles "username" is used, which is the name of a text field. This is why "fileArgs" is undefined and why the check of the length fails.
This should generate the following console output:
Example app listening at http://localhost:3000
TypeError: Cannot read properties of undefined (reading 'length')
at D:\Tests\tsoa_test\node_modules\@tsoa\runtime\dist\routeGeneration\templates\express\expressTemplateService.js:59:41
at Array.map (<anonymous>)
at ExpressTemplateService.getValidatedArgs (D:\Tests\tsoa_test\node_modules\@tsoa\runtime\dist\routeGeneration\templates\express\expressTemplateService.js:32:44)
at UsersController_updateUser (D:\Tests\tsoa_test\build\build\routes.js:99:45)
at Layer.handle [as handle_request] (D:\Tests\tsoa_test\node_modules\express\lib\router\layer.js:95:5)
at next (D:\Tests\tsoa_test\node_modules\express\lib\router\route.js:149:13)
at done (D:\Tests\tsoa_test\node_modules\multer\lib\make-middleware.js:45:7)
at indicateDone (D:\Tests\tsoa_test\node_modules\multer\lib\make-middleware.js:49:68)
at Multipart.<anonymous> (D:\Tests\tsoa_test\node_modules\multer\lib\make-middleware.js:166:7)
at Multipart.emit (node:events:518:28)
Context (Environment)
Version of the library: @tsoa/runtime: ^6.1.1 / @tsoa/cli: ^6.1.1
Version of NodeJS: v20.11.1
Confirm you were using yarn not npm: [ ]
Detailed Description
Breaking change?
The text was updated successfully, but these errors were encountered:
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Current Behavior
In an express application I have an endpoint which expects form-data. Text fields and file fields are mixed.
Whenever I try to send a request to this endpoint I get the error in "expressTemplateService" which is shown below. This error has first shown up in version 6.1.0. Older releases of tsoa worked as expected.
As is shown below, i have a file with the name "avatar":
But to access the requestedFiles "username" is used, which is the name of a text field. This is why "fileArgs" is undefined and why the check of the length fails.
Possible Solution
Steps to Reproduce
Add an Endpoint like this:
an send a request to this endpoint with Postman
This should generate the following console output:
Context (Environment)
Version of the library: @tsoa/runtime: ^6.1.1 / @tsoa/cli: ^6.1.1
Version of NodeJS: v20.11.1
Detailed Description
Breaking change?
The text was updated successfully, but these errors were encountered: