class-validator
Advanced tools
Changelog
0.9.0 [BREAKING CHANGE]
IsNumberString
decorator, now they are allowed+
symbol, this is not allowed anymoreIsPhoneNumber
decorator has been added which uses the [google-libphonenumber][google-libphonenumber] library to validate international phone numbers accuratelyIsURLOptions
to match underlying validator host list optionsMin
and Max
decorator will corectly show an inclusive error message when failingvalidationArguments.value
is not a stringChangelog
ValidationError.toString()
method for easier debuggingprintError
method to pretty-print errors in NodeJS or the browserValidatorOptions
ValidationSchema
(the options
key now is optional)IsNumericString
to IsNumberString
in the READMEhost_whitelist
and host_backlist
in IsURLOptions
Changelog
0.8.0 [BREAKING CHANGE]
updated [validator.js][validator-js] from 7.0.0 to 9.2.0 (Check it's [changelog][validator-js-release-notes] for what has changed.)
This caused breaking change, if you used the IsUrl
decorator to validate localhost
as a valid url, from now you must use the require_tld: false
option
@IsUrl({ require_tld: false})
url: string;
added @IsInstance
decorator and validator.isInstance(value, target)
method.
changed @IsNumber
decorator has been changed to @IsNumber(options: IsNumberOptions)
added option to strip unknown properties (whitelist: true
)
added option to throw error on unknown properties (forbidNonWhitelisted: true
)
added @Allow
decorator to prevent stripping properties without other constraint
@IsDateString
now it allow dates without fraction seconds to be set@IsDateString
now it allow dates without with timezones to be set@ValidateNested
correctly generates validation error on non object and non array values