Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidateIf should be handled like IsOptional #115

Open
Inoir opened this issue Oct 18, 2023 · 2 comments
Open

ValidateIf should be handled like IsOptional #115

Inoir opened this issue Oct 18, 2023 · 2 comments

Comments

@Inoir
Copy link

Inoir commented Oct 18, 2023

If you use ValidateIf in combination with IsDefined on an optional marked property in TS, the linter shows missing IsOptional decorator.

  @ValidateIf((o) => !o.id)
  @IsDefined()
  @IsString()
  key?: string

This should be valid.
Currently @darraghor/nestjs-typed/all-properties-have-explicit-defined throws: Optional properties must have @IsOptional() decorator

@darraghoriordan
Copy link
Owner

oh yea i dont think i did anything special for validateif. thanks for reporting.

I'll get to this before the end of the year hopefully

@adamvandenhoven
Copy link
Contributor

I've added a PR to implement this requested feature. First time for me, let me know what I've missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants