# Name Decorator swagger class parameter
Module | import { Name } from "@tsed/swagger" |
---|---|
Source | /packages/swagger/src/decorators/name.ts |
# Overview
function Name(name: string): Function;
# Description
Add a name metadata on the decorated element.
# Examples
# On parameters
async myMethod(@Name("nameOf") @PathParams("id") id: string): Promise<Model> {
}
1
2
3
2
3
# On property
class Model {
@Name("propAlias")
prop1: string;
}
1
2
3
4
2
3
4
# On Class
@Name("AliasName")
@Controller("/")
class ModelCtrl {
}
1
2
3
4
5
2
3
4
5
- 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