question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can class-validator check two related data?

See original GitHub issue

Can class-validator check two related data? For example

class Test {
    @IsNumber()
    a: number;
 
    @IsNumber()
    b: number;
}

If the b value range is determined based on the a value range, can I use class-validator to handle it?

In addition, can I get a complete Test class object in my custom decorator?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jgburetcommented, Sep 21, 2020
0reactions
github-actions[bot]commented, Feb 13, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to validate that one of 2 parameters are present ...
First, you must add a custom validation class (read document) and then define a custom decorator for that (read document). You can see...
Read more >
Argument and Input validation - TypeGraphQL
Note that by default, the skipMissingProperties setting of the class-validator is set to true because GraphQL will independently check whether the params/fields ...
Read more >
Validating nested objects with class-validator in NestJS
Today I have for you a quick and short article. Maybe it will help someone. I'm using class-validator... Tagged with nestjs, typescript, ...
Read more >
class-validator - npm Package Health Analysis - Snyk
Based on project statistics from the GitHub repository for the npm package class-validator, we found that it has been starred 8,698 times, and...
Read more >
Next Level Your Typescript Runtime Type Validation Using ...
This article aims to demonstrate a clean and easy way to validate data using Typescript class and class-validator decorators.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found