@tsed/schema
Version:
JsonSchema module for Ts.ED Framework
35 lines (34 loc) • 1.02 kB
TypeScript
import { Type } from "@tsed/core";
import { OpenSpec3 } from "@tsed/openspec";
import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
export type JsonTokenOptions = ({
token: Type<any>;
} & Partial<SpecSerializerOptions>)[];
export interface SpecSerializerOptions extends JsonSchemaOptions {
/**
* Paths
*/
paths?: Record<string, any>;
/**
* Channels
*/
channels?: Record<string, any>;
/**
* Root path. This paths will be added to all generated paths Object.
*/
rootPath?: string;
/**
* A function to generate the operationId.
*/
operationIdFormatter?: (name: string, propertyKey: string, path: string) => string;
/**
* A pattern to generate the operationId.
*/
operationIdPattern?: string;
}
/**
* Return the swagger or open spec for the given class.
* @param model
* @param options
*/
export declare function getSpec(model: Type<any> | JsonTokenOptions, options?: SpecSerializerOptions): Partial<OpenSpec3>;