# Description Decorator swagger schema

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

# Overview

function Description(description: string): (...args: any[]) => any;

# Description

Add description metadata on the decorated element.

WARNING

This decorator will be removed in v7.

For v5 user, use from @tsed/common instead of @tsed/swagger.

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

# Example

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

Will produce:

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