Complete the code to import the ValidationPipe from NestJS.
import { [1] } from '@nestjs/common';
The ValidationPipe is imported from @nestjs/common to enable validation features.
Complete the code to apply ValidationPipe globally in the main.ts file.
app.useGlobalPipes(new [1]());new.Using ValidationPipe globally ensures all incoming requests are validated automatically.
Fix the error in the ValidationPipe options to enable automatic transformation.
app.useGlobalPipes(new ValidationPipe({ transform: [1] }));The transform option must be a boolean true (without quotes) to enable automatic type conversion.
Fill both blanks to configure ValidationPipe to whitelist and forbid non-whitelisted properties.
app.useGlobalPipes(new ValidationPipe({ whitelist: [1], forbidNonWhitelisted: [2] }));Setting whitelist and forbidNonWhitelisted to true ensures only allowed properties are accepted and others cause errors.
Fill all three blanks to create a ValidationPipe with transform, whitelist, and forbidNonWhitelisted enabled.
app.useGlobalPipes(new ValidationPipe({ transform: [1], whitelist: [2], forbidNonWhitelisted: [3] }));Enabling transform, whitelist, and forbidNonWhitelisted all to true activates full validation and transformation features.