# Description Decorator

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

# Overview

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

# Description

Add a description metadata on the decorated element.

# Examples

# On class

@Description("description")
class Model {

}
1
2
3
4

# On method

@Controller("/")
class ModelCtrl {
   @Description("description")
   async method() {}
}
1
2
3
4
5

# On parameter

@Controller("/")
class ModelCtrl {
   async method(@Description("description") @PathParam("id") id: string) {}
}
1
2
3
4

# On property

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