# Decorator Description
Decorator validation swagger schema input classDecorator methodDecorator propertyDecorator parameterDecoratorModule | import { Description } from "@tsed/schema" |
---|---|
Source | /packages/specs/schema/src/types/decorators/common/description.ts |
# Overview
function Description(description: any): (...args: any[]) => any;
# Description
Add a description to the class, method or property
# Examples
# On class
@Description("description")
class Model {
}
1
2
3
4
2
3
4
# On method
@Controller("/")
class ModelCtrl {
@Description("description")
async method() {}
}
1
2
3
4
5
2
3
4
5
# On parameter
@Controller("/")
class ModelCtrl {
async method(@Description("description") @PathParam("id") id: string) {}
}
1
2
3
4
2
3
4
# On property
class Model {
@Description("description")
id: string;
}
1
2
3
4
2
3
4