Skip to content

JsonResponse

@tsed/schema

Usage

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

See /packages/specs/schema/src/types/domain/JsonResponse.ts.

Overview

ts
class JsonResponse extends JsonMap<JsonResponseOptions> {
    $kind: string;
    status: number;
    constructor(obj?: Partial<JsonResponseOptions>);
    description(description: string): this;
    headers(headers: Record<string, string | JsonHeader>): this;
    content(content: Record<string, OS3MediaType<JsonSchema>>): this;
    getContent(): JsonMap<JsonMedia>;
    getMedia(mediaType: string, create?: boolean): JsonMedia;
    addMedia(mediaType: string): this;
    isBinary(): boolean;
}

$kind

ts
$kind: string;

status

ts
status: number;

description

ts
description(description: string): this;

headers

ts
headers(headers: Record<string, string | JsonHeader>): this;

content

ts
content(content: Record<string, OS3MediaType<JsonSchema>>): this;

getContent

ts
getContent(): JsonMap<JsonMedia>;

getMedia

ts
getMedia(mediaType: string, create?: boolean): JsonMedia;

addMedia

ts
addMedia(mediaType: string): this;

isBinary

ts
isBinary(): boolean;

Released under the MIT License.