Skip to content

Produces

@tsed/schema

Usage

typescript
import { Produces } from "@tsed/schema";

See /packages/specs/schema/src/types/decorators/operations/produces.ts.

Overview

ts
function Produces(...produces: string[]): (...args: any[]) => any;

Description

Add produces metadata on the decorated element.

Examples

On method

typescript
class Model {
   @Produces("text/html")
   id: string;
}

WARNING

For openspec v3 prefer @Returns().ContentType() usage (see Returns).

Released under the MIT License.