@nestjs/swagger
Version:
OpenAPI for NestJS: generate the API document from controllers and decorators, serve Swagger UI, and derive request types with mapped types.
43 lines (42 loc) • 2.35 kB
TypeScript
import { ApiResponseMetadata, ApiResponseSchemaHost } from '../decorators/index.js';
import { ReferenceObject, SchemaObject } from '../interfaces/open-api-spec.interface.js';
export declare class ResponseObjectMapper {
private readonly mimetypeContentWrapper;
toArrayRefObject(response: Record<string, any>, name: string, produces: string[]): {
content: import("../interfaces/open-api-spec.interface.js").ContentObject;
};
toRefObject(response: Record<string, any>, name: string, produces: string[]): {
content: import("../interfaces/open-api-spec.interface.js").ContentObject;
};
wrapSchemaWithContent(response: ApiResponseSchemaHost & ApiResponseMetadata, produces: string[], schemas?: Record<string, SchemaObject>): Omit<ApiResponseSchemaHost & ApiResponseMetadata, "nullable"> | {
content: import("../interfaces/open-api-spec.interface.js").ContentObject;
schema?: SchemaObject & Partial<ReferenceObject>;
status?: number | "default" | "1XX" | "2XX" | "3XX" | "4XX" | "5XX";
description?: string;
summary?: string;
headers?: import("../interfaces/open-api-spec.interface.js").HeadersObject;
links?: import("../interfaces/open-api-spec.interface.js").LinksObject;
type?: import("@nestjs/common").Type<unknown> | Function | [Function] | string;
standardSchema?: import("../index.js").StandardSchemaObject;
isArray?: boolean;
nullable?: boolean;
example?: any;
} | {
content: import("../interfaces/open-api-spec.interface.js").ContentObject;
schema?: SchemaObject & Partial<ReferenceObject>;
status?: number | "default" | "1XX" | "2XX" | "3XX" | "4XX" | "5XX";
description?: string;
summary?: string;
headers?: import("../interfaces/open-api-spec.interface.js").HeadersObject;
links?: import("../interfaces/open-api-spec.interface.js").LinksObject;
type?: import("@nestjs/common").Type<unknown> | Function | [Function] | string;
standardSchema?: import("../index.js").StandardSchemaObject;
isArray?: boolean;
nullable?: boolean;
examples?: {
[key: string]: import("../decorators/api-response.decorator.js").ApiResponseExamples;
};
};
private toNullableSchema;
private mayBeObjectRef;
}