Skip to content

In

@tsed/schema

Usage

typescript
import { In } from "@tsed/schema";

See /packages/specs/schema/src/types/decorators/operations/in.ts.

Overview

ts
function In(inType: JsonParameterTypes | string): InChainedDecorators;

Description

Add a input parameter.

WARNING

Don't use decorator with Ts.ED application to decorate parameters. Use BodyParams, PathParams, etc... instead. But you can use this decorator on Method, to add extra in parameters like Authorization header.

typescript
@Controller("/")
class MyController {
   @Get("/")
   @In("header").Type(String).Name("Authorization").Required()
   method() {
   }
 }

Released under the MIT License.