Skip to content

Releases: express-validator/express-validator

v7.0.1

16 Apr 08:29
Compare
Choose a tag to compare
  • Fixed checkSchema() warning that known validators are unknown when its value is false - #1223

v7.0.0

15 Apr 09:31
Compare
Choose a tag to compare

πŸš€ πŸ™Œ First major version in almost 4 years! πŸš€ 🀯
Thanks everybody for having the patience. Hopefully this version brings many improvements to your developer experience!

Breaking changes πŸ’₯

  • Minimum supported Node.js version is now 14+
  • Removed deprecated APIs - #993
    • Import paths express-validator/check and express-validator/filter
    • Sanitization-only middlewares (e.g. sanitize(), sanitizeBody(), etc)
    • Deprecated TypeScript types (ValidationParamSchema and ValidationSchema)
  • isObject() validator now assumes options.strict = true by default
  • Validation errors changed shape
    • Field validation errors param property has been renamed to path
    • oneOf() validation errors no longer have a param: '_error' property
  • (TypeScript only) The ValidationError type is now a discriminated union, it might be necessary to use switch or if statements to check that you're dealing with the type that you want to debug/format
  • oneOf() signature changed: from oneOf(chains, message) to oneOf(chains, options: { message, errorType })
  • oneOf() default error structure now groups errors by their... validation group!, instead of in a flat list

Checkout the migration guide for examples on how to work around some of these:
https://express-validator.github.io/docs/migration-v6-to-v7

New features ✨

  • Added validation for no unknown fields - #558, #578, #612, #1148, #809, #927, #1204
  • Added globstars (deep wildcard) support - #790, #1137, #1216
  • Added support for multiple custom validators/sanitizers in checkSchema() - #552, #1180
  • Added request-level bail - #1100, #1214
  • Added a ExpressValidator class which allows adding "persistent" custom validators, sanitizers, and options - #1077, #1079, #1209
  • Added oneOf() support to .if() - #1170
  • Added new error types to oneOf() - #956, #1022

Bug fixes πŸ›

  • Validating/sanitizing arrays no longer drops all but the first value - #791, #755, #704, #1002
  • Added missing ko-KR to MobilePhoneLocale - #1218, #1219
  • Don't silently fail when setting withMessage and not in schemas - #664

New Contributors

Full Changelog: v6.15.0...v7.0.0

v6.15.0

16 Feb 16:50
5202222
Compare
Choose a tag to compare

What's Changed

Full Changelog: v6.14.3...v6.15.0

v6.14.3

20 Jan 23:31
Compare
Choose a tag to compare

What's Changed

  • docs: fixed typo in sanitization chain example by @ankushknr19 in #1195
  • fixed infinite recursion when the request has a field called * (#1205)

New Contributors

Full Changelog: v6.14.2...v6.14.3

v6.14.2

08 Oct 09:41
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v6.14.1...v6.14.2

v6.14.1

22 May 22:42
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v6.14.0...v6.14.1

v6.14.0

11 Dec 11:32
Compare
Choose a tag to compare

What's Changed

Full Changelog: v6.13.0...v6.14.0

v6.13.0

12 Oct 09:19
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v6.12.2...v6.13.0

v6.12.2

26 Sep 21:01
Compare
Choose a tag to compare

Fixes:

  • #1072: add type for checkSchema function return
  • #1092, #1086: correctly allow falsy values as options in checkSchema

v6.12.1

23 Jul 09:25
Compare
Choose a tag to compare
  • #1061, #1059 - allow using readonly arrays in TypeScript