Options
All
  • Public
  • Public/Protected
  • All
Menu

Enumeration ValidateType

use class-validator to validate request object

param ValidateOptions
param ValidateObject
example

class Test{
@IsBoolean()
test:Boolean;
}

export class Router{
@GET('/test')
@Validate({schema:Test,error:(errors)=> {
throw new Error(`${errors.map(error=>Object.values(error.constraints))}`)
},ValidateType.QueryParams)
async test(){
ctx.body = 'origin';
}
}

Index

Enumeration members

Enumeration members

Body

Body = "body"

Headers

Headers = "headers"

Params

Params = "params"

QueryParams

QueryParams = "query"

Generated using TypeDoc