Open karlismelderis-mckinsey opened 7 months ago
This is bit of a grey area but still would be nice if we wouldn't need to disable @darraghor/nestjs-typed/api-property-matches-property-optionality for every such property
@darraghor/nestjs-typed/api-property-matches-property-optionality
@IsOptional() @IsString() @Expose() @ApiPropertyOptional({ type: String, default: 'example', }) label: string = 'example';
@ApiPropertyOptional tells that users don't need to provide this data in body and it will be filled in with default
@ApiPropertyOptional
Can we add an option for the rule to accept @IsOptional if default is provided in @ApiPropertyOptional and property is required
@IsOptional
Yes, if you submit a PR for this it would be awesome. Thank you!
This is bit of a grey area but still would be nice if we wouldn't need to disable
@darraghor/nestjs-typed/api-property-matches-property-optionality
for every such property@ApiPropertyOptional
tells that users don't need to provide this data in body and it will be filled in with defaultCan we add an option for the rule to accept
@IsOptional
if default is provided in@ApiPropertyOptional
and property is required