# ReturnType Decorator operation response deprecated
Module | import { ReturnType } from "@tsed/common" |
---|---|
Source | /packages/common/src/mvc/decorators/method/returnType.ts |
# Overview
function ReturnType(response?: Partial<IResponseOptions>): Function;
# Description
Define the returned type for the serialization.
WARNING
This decorator will be removed in v6 in favor of from @tsed/schema. For v5 user, use decorator from @tsed/common then in v6 switch to @tsed/schema.
@Controller('/')
export class Ctrl {
@Get('/')
@ReturnType({code: 200, type: User, collectionType: Map})
get(): Promise<Map<User>> { }
}
1
2
3
4
5
6
7
2
3
4
5
6
7
- 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