# Class JsonOperation
ClassModule | import { JsonOperation } from "@tsed/schema" |
---|---|
Source | /packages/specs/schema/src/types/domain/JsonOperation.ts |
# Overview
class JsonOperation extends JsonMap<JsonOperationOptions> {
#private;
$kind: string;
readonly operationPaths: Map<string, JsonMethodPath>;
constructor(obj?: Partial<JsonOperationOptions>);
get response(): JsonResponse | undefined;
get status(): number;
tags(tags: OpenSpecTag[]): this;
addTags(tags: OpenSpecTag[]): this;
summary(summary: string): this;
operationId(operationId: string): this;
responses(responses: JsonMap<any>): this;
defaultStatus(status: number): this;
getStatus(): number;
setRedirection(status?: number): this;
isRedirection(status?: number): boolean | 0;
addResponse(statusCode: string | number, response: JsonResponse): this;
getResponses(): JsonMap<JsonResponse>;
getResponseOf(status: number | string): JsonResponse;
ensureResponseOf(status: number | string): JsonResponse;
getHeadersOf(status: number): Record<string, JsonHeader & {
example: string;
}>;
getContentTypeOf(status: number): any;
security(security: OpenSpecSecurity): this;
addSecurityScopes(name: string, scopes: string[]): this;
description(description: string): this;
deprecated(deprecated: boolean): this;
parameters(parameters: JsonParameter[]): this;
addParameter(index: number, parameter: JsonParameter): void;
consumes(consumes: string[]): this;
produces(produces: string[]): this;
addProduce(produce: string): void;
addOperationPath(method: string, path: string | RegExp, options?: any): this;
getAllowedOperationPath(allowedVerbs?: string[]): JsonMethodPath[];
}
# Members
#private;
$kind: string;
readonly operationPaths: Map<string, JsonMethodPath>;
get response(): JsonResponse | undefined;
get status(): number;
tags(tags: OpenSpecTag[]): this;
addTags(tags: OpenSpecTag[]): this;
summary(summary: string): this;
operationId(operationId: string): this;
responses(responses: JsonMap<any>): this;
defaultStatus(status: number): this;
getStatus(): number;
setRedirection(status?: number): this;
isRedirection(status?: number): boolean | 0;
addResponse(statusCode: string | number, response: JsonResponse): this;
getResponses(): JsonMap<JsonResponse>;
getResponseOf(status: number | string): JsonResponse;
ensureResponseOf(status: number | string): JsonResponse;
getHeadersOf(status: number): Record<string, JsonHeader & {
example: string;
}>;
getContentTypeOf(status: number): any;
security(security: OpenSpecSecurity): this;
addSecurityScopes(name: string, scopes: string[]): this;
description(description: string): this;
deprecated(deprecated: boolean): this;
parameters(parameters: JsonParameter[]): this;
addParameter(index: number, parameter: JsonParameter): void;
consumes(consumes: string[]): this;
produces(produces: string[]): this;
addProduce(produce: string): void;
addOperationPath(method: string, path: string | RegExp, options?: any): this;
getAllowedOperationPath(allowedVerbs?: string[]): JsonMethodPath[];