UNPKG

@tsed/common

Version:
48 lines (47 loc) 940 B
import { JSONSchema6 } from "json-schema"; /** * Write data formatted to JsonSchema. * * ::: warning * This decorator will be removed in v7. * For v6 user, use @@Schema@@ decorator from @tsed/schema. * ::: * * ## Example * * ```typescript * @Schema({title: "test"}) * class Model { * @Schema({formatMinimum: "1987-10-24"}) * @Format("date") * birthDate: Date * } * ``` * * Will produce: * * ```json * { * "type": "object", * "title": "test", * "properties": { * "birthdate": { * "type": "string", * "format": "date", * "formatMinimum": "1987-10-24" * } * } * } * ``` * * @param partialSchema * @decorator * @validation * @swagger * @schema * @classDecorator * @input * @ignore * @deprecated Since v6. Use @Schema decorator from @tsed/schema instead of. */ export declare function Schema(partialSchema: Partial<JSONSchema6>): (...args: any[]) => any;