# Decorator Description
Decorator validation swagger schema input classDecorator methodDecorator propertyDecorator parameterDecoratorModule | import { Description } from "@tsed/schema" |
---|---|
Source | /packages/schema/src/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
Other topics
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Seq
- OIDC
- Stripe
- Controllers
- Providers
- Model
- JsonMapper
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Exceptions
- Hooks
- Response Filter
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing