# Title Decorator swagger schema classDecorator propertyDecorator input
Module | import { Title } from "@tsed/common" |
---|---|
Source | /packages/common/src/jsonschema/decorators/title.ts |
# Overview
function Title(title: string): Function;
# Description
Add title 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 {
@Title("title")
id: string;
}
1
2
3
4
2
3
4
Will produce:
{
"type": "object",
"properties": {
"id": {
"type": "string",
"title": "title"
}
}
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing