From 06895d46925e521d1c1378a443fdb14266071d07 Mon Sep 17 00:00:00 2001 From: Henry Puma Date: Wed, 13 Mar 2024 01:23:13 -0400 Subject: [PATCH] Updated validation for bing to account for undefined values for category field --- src/bing/api/dto/get-response.dto.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bing/api/dto/get-response.dto.ts b/src/bing/api/dto/get-response.dto.ts index 9bf0f7b..84a8e44 100644 --- a/src/bing/api/dto/get-response.dto.ts +++ b/src/bing/api/dto/get-response.dto.ts @@ -5,6 +5,7 @@ import { IsArray, ValidateNested, IsNumber, + ValidateIf, } from 'class-validator'; import { Type } from 'class-transformer'; @@ -98,6 +99,7 @@ export class NewsArticle { about?: any[]; @IsString() + @IsOptional() category: string; @IsOptional()