File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
import {
2
- IsNotEmpty , IsString ,
2
+ IsDefined ,
3
+ IsString ,
3
4
} from 'class-validator' ;
4
5
import { ApiProperty } from '@nestjs/swagger' ;
5
6
@@ -9,7 +10,7 @@ export class PublishDto {
9
10
description : 'Message to send' ,
10
11
example : '{"hello":"world"}' ,
11
12
} )
12
- @IsNotEmpty ( )
13
+ @IsDefined ( )
13
14
@IsString ( )
14
15
message : string ;
15
16
@@ -18,7 +19,7 @@ export class PublishDto {
18
19
description : 'Chanel name' ,
19
20
example : 'channel-1' ,
20
21
} )
21
- @IsNotEmpty ( )
22
+ @IsDefined ( )
22
23
@IsString ( )
23
24
channel : string ;
24
25
}
Original file line number Diff line number Diff line change @@ -16,10 +16,8 @@ const endpoint = (instanceId = constants.TEST_INSTANCE_ID) =>
16
16
request ( server ) . post ( `/instance/${ instanceId } /pub-sub/messages` ) ;
17
17
18
18
const dataSchema = Joi . object ( {
19
- channel : Joi . string ( ) . required ( ) ,
20
- message : Joi . string ( ) . required ( ) ,
21
- } ) . messages ( {
22
- 'any.required' : '{#label} should not be empty' ,
19
+ channel : Joi . string ( ) . allow ( '' ) . required ( ) ,
20
+ message : Joi . string ( ) . allow ( '' ) . required ( ) ,
23
21
} ) . strict ( ) ;
24
22
25
23
const validInputData = {
You can’t perform that action at this time.
0 commit comments