Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

tchambard
Copy link
Contributor

@tchambard tchambard commented Dec 31, 2019

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

@tnrich
Copy link
Collaborator

tnrich commented Feb 21, 2020

@tchambard this all looks good to me. Do you know why this is breaking travisCI?

@@ -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,=======
Copy link
Collaborator

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?

Copy link
Collaborator

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

Copy link
Contributor Author

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...

@coveralls
Copy link

coveralls commented Oct 22, 2020

Coverage Status

Coverage increased (+0.4%) to 75.175% when pulling 2cb7cb9 on tchambard:feature/stream-file-param-decorator into d5c28fb on thiagobustamante:master.

@tchambard tchambard force-pushed the feature/stream-file-param-decorator branch from 8b83a52 to cb45ed9 Compare October 22, 2020 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants