# Title Decorator validation swagger schema classDecorator input

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

# Overview

function Title(title: string): (...args: any[]) => any;

# Description

Add title metadata on the decorated element.

WARNING

For v6 user, use Title from @tsed/schema instead of @tsed/common.

# Example

class Model {
   @Title("title")
   id: string;
}
1
2
3
4

Will produce:

{
  "type": "object",
  "properties": {
    "id": {
       "type": "string",
       "title": "title"
    }
  }
}
1
2
3
4
5
6
7
8
9

Other topics