• Parameter decorator which defines a request body parameter to be provided to the Express route

    Example

    @Controller('/api', 'User', 'User Management Routes')
    class User {

    @HttpPut('/user/:userId', 'Update an existing user')
    async createUser(
    @UrlParam('userId') userId: number,
    @RequestParam('password') password: string,
    @Response() res: ExpressResponse
    ): Promise<void> {
    ...
    }
    }

    Type Parameters

    • T

      Class method to be registered with the Express application as a route

    Parameters

    • key: string

      name of parameter in request body

    • Optional summary: string

      description of the parameter for OpenAPI documentation

    • Optional exampleValue: string | number | boolean

      example of expected data

    • Optional required: boolean

      indicate if this parameter is required

    Returns ((target: T, propertyKey: string, parameterIndex: number) => void)

      • (target: T, propertyKey: string, parameterIndex: number): void
      • Parameters

        • target: T
        • propertyKey: string
        • parameterIndex: number

        Returns void

Generated using TypeDoc