async index(@Query() dto: AuthLogin) {
return "somethins"
}
export class AuthLogin {
@IsString()
@ApiProperty({
description: '支持的登陆类型',
required: true,
default: 'google-oauth2',
type: 'string',
})
type = 'google-oauth2'
@IsString()
@ApiProperty({
description: '回调到前端的地址',
required: false,
})
callbackUrl: string
@IsBoolean()
@ApiProperty({
description: 'UI 登陆方式',
required: false,
default: false,
type: 'boolean',
})
prompt = false
}
app.useGlobalPipes(
new ValidationPipe({
transform: true,
transformOptions: {
enableImplicitConversion: true,
},
}),
)
@IsBoolean does not convert values
does not seem to handle the case where the metatype is class.