diff --git a/src/movies.controller.ts b/src/movies.controller.ts index df55548..60880bd 100644 --- a/src/movies.controller.ts +++ b/src/movies.controller.ts @@ -7,63 +7,75 @@ import { Param, Query, } from '@nestjs/common'; -import { EnrichedDataService } from './types'; -import { IsIn, IsInt, IsOptional, IsString, Length } from 'class-validator'; +import { ApiPropertyOptional } from '@nestjs/swagger'; import { Type } from 'class-transformer'; +import { IsIn, IsInt, IsOptional, IsString, Length } from 'class-validator'; +import { EnrichedDataService } from './types'; const ENTRY_TYPES = ['movie', 'series', 'episode'] as const; class SearchDto { + @ApiPropertyOptional() @IsString() @Length(1) @IsOptional() actors?: string; + @ApiPropertyOptional() @IsString() @Length(2, 2) @IsOptional() availableLanguages?: string; + @ApiPropertyOptional() @IsString() @Length(1) @IsOptional() directors?: string; + @ApiPropertyOptional() @IsString() @Length(1) @IsOptional() localTitle?: string; + @ApiPropertyOptional() @IsString() @Length(2, 2) @IsOptional() originalLanguage?: string; + @ApiPropertyOptional() @IsString() @Length(1) @IsOptional() productionCountries?: string; + @ApiPropertyOptional() @IsInt() @Type(() => Number) @IsOptional() productionYear?: number; + @ApiPropertyOptional() @IsString() @Length(1) @IsOptional() studios?: string; + @ApiPropertyOptional() @IsString() @Length(1) @IsOptional() title?: string; + @ApiPropertyOptional() @IsString() @IsIn(ENTRY_TYPES) @IsOptional() type?: (typeof ENTRY_TYPES)[number]; + @ApiPropertyOptional() @IsString() @Length(1) @IsOptional()