I'm trying to inject my users service into my validator constraint interface but it doesn't seem to work: import { ValidatorConstraintInterface, ValidatorConst
class Product { @Min(0, { message: 'should be positive number' }) @IsNotEmpty({ message: 'should not be empty' }) @Type(() => Number) price: number;
I have a mongoose discriminator schema, which mean the data will be different according to one of the attributes. class Feature { name: string option: Colo
import { isEmail, isEmpty, isPhoneNumber, Length } from "class-validator" import { Field, InputType } from "type-graphql"; @InputType() export class RegisterIn
I have created a sample application to save data for a user. I wanted to know how to validate it before saving and showing the response in JSON. I have got a re
I have an array of dates in a post request body that I want to validate: { "meals": [...], "dates": [ "2022-03-06T11:00:00.000Z", "2022-
Using class-validator along with NestJS I want to validate that a user provides either propertyA or a propertyB but they don't need to provide both. Currently,