Open lucasmfredmark opened 3 years ago
You can use nestJS ValidationPipe for this.
// main.ts
async function bootstrap(): Promise<void> {
...
const validationPipeOptions: ValidationPipeOptions = {
skipMissingProperties: false,
forbidNonWhitelisted: true,
always: true,
whitelist: true,
};
app.useGlobalPipes(new ValidationPipe(validationPipeOptions));
...
}
https://github.com/nestjsx/crud/wiki/Controllers#validation
Currently it's only possible to set
validation
configuration on controller level. It would be nice if this could be set at a global level as well, so you don't need to duplicate this for all controllers. The config should still be overridable on controller level.