Skip to content

tsoa-next / tsoa-next / SuccessResponse

Function: SuccessResponse()

ts
function SuccessResponse<HeaderType>(
   name, 
   description?, 
   produces?): MethodDecorator;

Defined in: packages/runtime/src/decorators/response.ts:12

Declares the successful response status, description, and media types for an operation.

Type Parameters

HeaderType

HeaderType extends | object | "Header names must be of type string" | "Header values must be string or string[]" = object

Parameters

name

string | number

The HTTP status code returned when the operation succeeds.

description?

string

The response description shown in the generated OpenAPI document.

produces?

string | string[]

The response media type or media types.

Returns

MethodDecorator

TypeScript-first OpenAPI generation, route generation, and runtime validation.