File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 6
6
import { SwaggerModule , DocumentBuilder } from '@nestjs/swagger' ;
7
7
8
8
import { AppModule } from './app.module' ;
9
+ import { ValidationPipe } from '@nestjs/common' ;
9
10
10
11
async function bootstrap ( ) {
11
12
const fastifyAdapter = new FastifyAdapter ( ) ;
@@ -14,11 +15,20 @@ async function bootstrap() {
14
15
fastifyAdapter ,
15
16
) ;
16
17
18
+ app . useGlobalPipes (
19
+ new ValidationPipe ( {
20
+ whitelist : true ,
21
+ forbidNonWhitelisted : true ,
22
+ } ) ,
23
+ ) ;
24
+
17
25
const config = new DocumentBuilder ( )
18
26
. setTitle ( 'SOS - Rio Grande do Sul' )
19
27
. setDescription ( '...' )
20
28
. setVersion ( '1.0' )
29
+ . addBearerAuth ( )
21
30
. build ( ) ;
31
+
22
32
const document = SwaggerModule . createDocument ( app , config ) ;
23
33
SwaggerModule . setup ( 'api' , app , document ) ;
24
34
You can’t perform that action at this time.
0 commit comments