0.11.0 (2019-11-01)
- create instance of ValidationError for whitelist errors (#434) (a98f5dd), closes #325
- pass context for isDefined and custom validators (#296) (0ef898e), closes #292
- add isHash validator (#445) (c454cf9)
- add isISSN validator (#450) (4bd586e)
- add isJWT validator (#444) (874861b)
- add isMACAddress validator (#449) (45b7df7)
- add support for maxDecimalPlaces on IsNumber (#381) (a4dc10e)
- update @types/validator from 11.1.0 to version 12.0.0 - please check it's changelog
0.10.2 (2019-10-14)
- add isLatLong, isLatitude, isLongtitude validators (#427) (3fd15c4), closes #415
- add IsObject and IsNotEmptyObject new decorators (#334) (0a41aeb)
- support ES6 Map and Set for regular validators with each option (#430) (a055bba), closes #428
0.10.1 (2019-09-25)
- add default message for isMilitaryTime validator (#411) (204b7df), closes #287
- add default message for isPort validator (#404) (74e568c)
- add locale parameter for isAlpha and isAlphanumeric validat… (#406) (2f4bf4e)
0.10.0 (2019-08-10)
- add correct signature for custom error message handler (249c41d)
- add
IsISO31661Alpha3
andIsISO31661Alpha2
validators (#273) (55c57b3) - IsDecimal: implement
IsDecimal
from validatorjs (#359) (b4c8e21) - add
isPort
decorator (#282) (36684ec) - allow validate Map/Set (#365) (f6fcdc5)
- new
ValidatePromise
decorator - resolve promise before validate (#369) (35ec04d) - replace instanceof Promise and support Promise/A+ (#310) (59eac09)
isNumberString
now accept validator.jsIsNumericOptions
as second parameter (#262)
- update @types/validator from 10.4.0 to version 10.11.2 - please check it's changelog (cb960dd)
isDateString
now check to match only entire ISO Date (#275) (5012464)- remove
IsCurrencyOptions
,IsURLOptions
,IsEmailOptions
,IsFQDNOptions
interfaces and replace with interfaces from@types/validator
- added option to pass custom context for the decorators
- validating against a schema will validate against that one instead of every registered one
0.9.0 [BREAKING CHANGE]
- update
IsURLOptions
to match underlying validator host list options - added a console warning when no metadata decorator is found as it's possibly not intended
- the
Min
andMax
decorator will corectly show an inclusive error message when failing - fixed a runtime error when
validationArguments.value
is not a string
- remove
ansicolor
package, because it's incompatible with IE
ValidatorOptions
now has aforbidUnknownValues
key to prevent unknown objects to pass validation- it's highly advised to turn this option on
- now this option defaults to
false
but will be default totrue
after the 1.0 release
- handle when
target
property is undefined when callingValidationError.toString()
- added
ValidationError.toString()
method for easier debugging - added
printError
method to pretty-print errors in NodeJS or the browser
- fixed wrong type info in
ValidatorOptions
- fixed wrong type info in
ValidationSchema
(theoptions
key now is optional) - corrected
IsNumericString
toIsNumberString
in the README - fixed type of
host_whitelist
andhost_backlist
inIsURLOptions
- fixed wrong type info in
ValidatorOptions
-
updated validator.js from 7.0.0 to 9.2.0 (Check it's changelog for what has changed.)
This caused breaking change, if you used the
IsUrl
decorator to validatelocalhost
as a valid url, from now you must use therequire_tld: false
option@IsUrl({ require_tld: false}) url: string;
-
added
@IsInstance
decorator andvalidator.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
- fixed issue with
@IsDateString
now it allow dates without fraction seconds to be set - fixed issue with
@IsDateString
now it allow dates without with timezones to be set @ValidateNested
correctly generates validation error on non object and non array values
- fixed issue with
@ValidateNested
when nested property is not defined and it throw an error (#59)
- fixed bugs with
@IsUrl
,@IsEmail
and several other decorators
- added
@IsMilitaryTime
decorator.
- added
validateOrReject
method which rejects promise instead of returning array of errors in resolved result
- added
@IsArray
decorator.
- breaking change with
@ValidateNested
on arrays: Validator now groups the validation errors by sub-object, rather than them all being grouped together. See #32 for a demonstration of the updated structure. - added
@ValidateIf
decorator, see conditional validation in docs.
-
async validations must be marked with
{ async: true }
option now.This is optional, but it helps to determine which decorators are async to prevent their execution in
validateSync
method. -
added
validateSync
method that performs non asynchronous validation and ignores validations that marked withasync: true
. -
there is a breaking change in
registerDecorator
method. Now it accepts options object. -
breaking change with
@ValidatorConstraint
decorator. Now it accepts option object instead of single name.
- fixed issue with wrong source maps packaged
- everything should be imported from "class-validator" main entry point now
ValidatorInterface
has been renamed toValidatorConstraintInterface
- contain can be set in the main entry point now
- some decorator's names changed. Be aware of this
- added few more non-string decorators
- validator now returns array of ValidationError instead of ValidationErrorInterface. Removed old ValidationError
- removed all other validation methods except
validator.validate
- finally validate method is async now, so custom async validations are supported now
- added ability to validate inherited properties
- added support of separate validation schemas
- added support of default validation messages
- added support of special tokens in validation messages
- added support of message functions in validation options
- added support of custom decorators
- if no groups were specified, decorators with groups now are being ignored
- changed signature of the
ValidationError
. Now if it has nested errors it does not return them in a flat array
- fixed all decorators that should not work only with strings
- package has changed its name from
validator.ts
toclass-validator
. - sanitation functionality has been removed from this library. Use class-sanitizer instead.