nestia
nestia copied to clipboard
[Suggestion] Support API responses in file stream format.
Description
There are cases where API responses come in file (stream) format. Regardless of the NestJS Controller handler's return type, I want to change the response content type in Swagger or SDK documentation by recognizing the Header information.
In the NestJS official documentation, they guide both methods: directly connecting to the express or fastify response object using express(or fastify) res.pipe, and using the StreamableFile class as the handler return.
Can you please review support for some response content types (e.g. image/ ~ , video/ ~)?
@nestia/sdk v4.6.1
Suggestion
-
nest.Header("Content-Type", "image/*") - If the content-type is specified with a specific prefix (e.g., image, video), expect the API response to be in stream format, regardless of the controller handler's return type.
- Swagger Example
- Specify the sdk response body type as
ReadableStream<Uint8Array<ArrayBufferLike>>.
current workaround would be to use SwaggerCustomizer decorator