title: custom-validator validate object keys
body: <p>I build nestjs with a typescript project and I'm trying to validate filters query params.
  I want only filter keys and values can pass validation.
  example for good params: pass validation</p>
  <pre><code>any-endpoint?filters={&quot;userIds&quot;=[&quot;1&quot;,&quot;2&quot;,&quot;5&quot;],&quot;ages&quot;=[25]}
  
  any-endpoint?filters={&quot;names&quot;=[&quot;david&quot;,&quot;samuel&quot;],&quot;ages&quot;=[21]}
  </code></pre>
  <p>example for bad params: failed validation</p>
  <pre><code>any-endpoint?filters={&quot;blaBla&quot;=[&quot;1&quot;,&quot;2&quot;,&quot;5&quot;],&quot;ages&quot;=[25]} // here the key blaBla not one of the filters options
  
  any-endpoint?filters={&quot;names&quot;=[1,2]} // here the values of names is not string, it should be string
  </code></pre>
  <p>my code</p>
  <pre><code>import { IsNumber, IsOptional,IsArray, IsString } from 'class-validator';
  
  class FiltersOptionsDto {
    @IsOptional()
    @IsArray()
    @IsString({ each: true })
    userIds?: string[];
  
    @IsOptional()
    @IsArray()
    @IsString({ each: true })
    ages?: number[];
  
    @IsOptional()
    @IsArray()
    @IsNumber({}, { each: true })
    names?: string[];
  }
  
  export class AQueryDto {
    @IsOptional()
    // what to add here?
    filters?: FiltersOptionsDto;
  }
  </code></pre>
  <p>how to do it?</p>