Skip to content

Commit f85146f

Browse files
committed
fix(bench): add min/max validation for maxCyclomaticComplexity
1 parent d80ee07 commit f85146f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/benchmarks/dto/create-benchmark.dto.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2-
import { IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';
2+
import {
3+
IsNotEmpty,
4+
IsNumber,
5+
IsOptional,
6+
IsString,
7+
Max,
8+
Min,
9+
} from 'class-validator';
310

411
export class CreateBenchmarkDto {
512
@IsNotEmpty()
@@ -25,5 +32,7 @@ export class CreateBenchmarkDto {
2532

2633
@IsNotEmpty()
2734
@IsNumber()
35+
@Min(1)
36+
@Max(100)
2837
maxCyclomaticComplexity: number;
2938
}

0 commit comments

Comments
 (0)