# Schema Decorator

Module
import { Schema } from "@tsed/common"
Source/packages/common/src/jsonschema/decorators/schema.ts

# Overview

function Schema(partialSchema: Partial<JsonSchema>): (...parameters: any[]) => any;

# Description

Write data formatted to JsonSchema.

# Example

@Schema({title: "test"})
class Model {
   @Schema({formatMinimum: "1987-10-24"})
   @Format("date")
   birthDate: Date
}
1
2
3
4
5
6

Will produce:

{
  "type": "object",
  "title": "test",
  "properties": {
    "birthdate": {
       "type": "string",
       "format": "date",
       "formatMinimum": "1987-10-24"
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11