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
the above code would provide tsoa with the themulterInstance which it would use as it's multer instance instead of initializing it's own multer instance.
Current Behavior
Although we can customize the multerOpts using the tsoa.json, it seems to be incomplete as it is incapable of inserting storage engine to the multerOpts, rightfully so as it is a json file. This has caused some issue when i wanted to use multer-s3 as the storage engine for multer and also maintain the single truth in controller idea.
Using the @UploadedFile decorator will use the tsoa's multer instance, which cannot use multer-s3 is not a valid option.
Inserting my own multer middleware on top of the decorator will cause the request to fail as two multer instances(my multer-s3 multer instance and tsoa's multer instance) try to read file from the same request.
Only using the middleware will cause the swagger file to not have information about the file(although this can be mitigated by using this guide, I think this is a tedious and bandaid solution which doesn't follow the tsoa mantra of having single truth controller)
Possible Solution
See Expected Behaviour
P.S. I am new here, if I broke any rules, i apologize in advance.
The text was updated successfully, but these errors were encountered:
Would you like to submit a PR for this?
We can probably even deprecate the old way in this case, which is more flexible.
For convenience, the api should probably be RegisterRoutes(app, {multer}), I like that suggestion
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Ability to add my own custom multer instance to the tsoa instance as follow:
since above method seems out of scope for the
RegisterRoutes
function, we could do something likethe above code would provide tsoa with the the
multerInstance
which it would use as it's multer instance instead of initializing it's own multer instance.Current Behavior
Although we can customize the multerOpts using the tsoa.json, it seems to be incomplete as it is incapable of inserting storage engine to the multerOpts, rightfully so as it is a json file. This has caused some issue when i wanted to use multer-s3 as the storage engine for multer and also maintain the single truth in controller idea.
Possible Solution
See Expected Behaviour
P.S. I am new here, if I broke any rules, i apologize in advance.
The text was updated successfully, but these errors were encountered: