验证pipe禁止未定义的字段
This commit is contained in:
@@ -8,6 +8,7 @@ async function bootstrap() {
|
|||||||
app.useGlobalPipes(new ValidationPipe({
|
app.useGlobalPipes(new ValidationPipe({
|
||||||
transform: true,
|
transform: true,
|
||||||
whitelist: true,
|
whitelist: true,
|
||||||
|
forbidNonWhitelisted: true,
|
||||||
stopAtFirstError: true,
|
stopAtFirstError: true,
|
||||||
exceptionFactory: (errors) => {
|
exceptionFactory: (errors) => {
|
||||||
const error = errors[0];
|
const error = errors[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user