title: Nodejs, an unknown value was passed to the validate function, But I Cant find whats wrong with
body: <p>Thank you for stopping by for help.
  I have API woring on using NodeJs,
  It has 3 arguments It accepts, but It seems like there is an issue on validation.
  When I call the API, It gives me this result,</p>
  
  <pre><code>[{
    &quot;statusCode&quot;: 400,
    &quot;message&quot;: [
      &quot;an unknown value was passed to the validate function&quot;
    ],
    &quot;error&quot;: &quot;Bad Request&quot;
  }]
  </code></pre>
  <p>Help me anyone can tell what's wrong with this!</p>
  <p>I put three arguments, in order of,</p>
  <ul>
  <li><code>https://www.youtube.com/watch?v=C5Y3fpHg45U</code></li>
  <li><code>1</code></li>
  <li><code>JP</code></li>
  </ul>
  <p>and there goes my code</p>
  <pre><code>  /**
     * Gets Subtitle From Youtube
     * @param getYoutubeSubtitleDto
     */
    public async getSubtitle(
      getYoutubeSubtitleDto: GetYoutubeSubtitleDto,
    ): Promise&lt;Subtitle[]&gt; { 
      const { videoId, lang, projectId } = getYoutubeSubtitleDto
      return this.getOrCreateSubtitles(videoId, lang, projectId)
    }
  </code></pre>
  <pre><code>export class GetYoutubeSubtitleDto extends Video {
    @ApiProperty()
    @IsNumber()
    @Type(() =&gt; Number)
    projectId: number
  
    @ApiProperty({ description: 'Translation Language' })
    @IsString()
    lang: string
  }
  
  </code></pre>
  <pre><code>export const YOUTUBE_LINK_REGEX = /http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&amp;(amp;)?‌​[\w\?‌​=]*)?/
  
  export class Video {
    @ApiProperty({ description: 'Youtube Link' })
    @IsString()
    @Matches(YOUTUBE_LINK_REGEX)
    video: string
  
    public get videoId(): string { 
      return YOUTUBE_LINK_REGEX.exec(this.video)[1]
    }
  }
  </code></pre>