Skip to content

covenix / ReturnsFile

Function: ReturnsFile()

ReturnsFile(status, options?): MethodDecorator

Defined in: src/decorators.ts:229

Declares a binary/file response for a status code. Stackable. The handler should return a FileResponse for this status (covenix streams it); this decorator only advertises the binary body in the generated OpenAPI document ({ type: 'string', format: 'binary' }).

Parameters

status

number

HTTP status code, e.g. 200.

options?

ReturnsFileOptions = {}

Media type / description for the OpenAPI document.

Returns

MethodDecorator