-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add StreamFile(s)Param decorators #102
base: master
Are you sure you want to change the base?
Add StreamFile(s)Param decorators #102
Conversation
@tchambard this all looks good to me. Do you know why this is breaking travisCI? |
src/metadata/parameterGenerator.ts
Outdated
@@ -106,7 +110,7 @@ export class ParameterGenerator { | |||
return { | |||
description: this.getParameterDescription(parameter), | |||
in: 'formData', | |||
name: getDecoratorTextValue(this.parameter, ident => ident.text === 'FilesParam') || parameterName, | |||
name: getDecoratorTextValue(this.parameter, ident => ident.text === 'FilesParam' || ident.text === 'StreamFilesParam') || parameterName,======= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchambard looks like this line has a bunch of ======= signs added to the end of it. I assume by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what is probably breaking the CI tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tnrich I fixed it.
Indeed it was a mitake...
8b83a52
to
cb45ed9
Compare
# Conflicts: # src/metadata/parameterGenerator.ts
In order to be able to pipe the request in express handlers implementations (stream) instead of using multer like typescript-rest is doing with FileParam decorator, the new StreamFileParam decorator will generate the correct swagger button for uploading binary file.
I just added some unit tests for @FileParam and @StreamFileParam parameters.
So, the difference between @FileParam and @StreamFileParam is simple.
@FileParam is interpreted by typescript-rest module as a Multer file element, and the content of the multipart request is consumed by the Http server.
With @StreamFileParam, nothing is done, and you still have the chance to pipe your request to another Http server in order to process streaming...
See #47 for previous comments