Skip to content
Snippets Groups Projects

Json validation

Merged Ghost User requested to merge json-validation into Development
9 files
+ 135
40
Compare changes
  • Side-by-side
  • Inline
Files
9
+ 10
1
@@ -4,6 +4,9 @@ import {
@@ -4,6 +4,9 @@ import {
Validate,
Validate,
IsString,
IsString,
IsNotEmpty,
IsNotEmpty,
 
IsNumber,
 
Min,
 
Max,
} from 'class-validator';
} from 'class-validator';
import { GameEntity } from '../game/game.entity';
import { GameEntity } from '../game/game.entity';
@@ -14,9 +17,15 @@ import { FactionEntity, GameGroupEntity } from './faction.entity';
@@ -14,9 +17,15 @@ import { FactionEntity, GameGroupEntity } from './faction.entity';
export class FactionDTO {
export class FactionDTO {
@IsString()
@IsString()
@IsNotEmpty()
@IsNotEmpty()
@Length(2, 15)
@Length(2, 31)
factionName: string;
factionName: string;
 
@IsString()
 
@IsNotEmpty()
 
@Length(3, 15)
factionPassword: string;
factionPassword: string;
 
@IsNumber()
 
@Min(1)
 
@Max(3)
multiplier?: number;
multiplier?: number;
game: GameDTO;
game: GameDTO;
}
}
Loading