express-validator

An express.js middleware for validator.js.

MIT License

Downloads
3.6M
Stars
6.1K
Committers
133

Bot releases are hidden (Show)

express-validator - v7.0.1 Latest Release

Published by gustavohenke over 1 year ago

  • Fixed checkSchema() warning that known validators are unknown when its value is false - #1223
express-validator - v7.0.0

Published by gustavohenke over 1 year ago

🚀 🙌 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: https://github.com/express-validator/express-validator/compare/v6.15.0...v7.0.0

express-validator - v6.15.0

Published by fedeci over 1 year ago

What's Changed

Full Changelog: https://github.com/express-validator/express-validator/compare/v6.14.3...v6.15.0

express-validator - v6.14.3

Published by gustavohenke almost 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/express-validator/express-validator/compare/v6.14.2...v6.14.3

express-validator - v6.14.2

Published by gustavohenke about 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/express-validator/express-validator/compare/v6.14.1...v6.14.2

express-validator - v6.14.1

Published by gustavohenke over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/express-validator/express-validator/compare/v6.14.0...v6.14.1

express-validator - v6.14.0

Published by fedeci almost 3 years ago

What's Changed

Full Changelog: https://github.com/express-validator/express-validator/compare/v6.13.0...v6.14.0

express-validator - v6.13.0

Published by fedeci about 3 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/express-validator/express-validator/compare/v6.12.2...v6.13.0

express-validator -

Published by fedeci about 3 years ago

Fixes:

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

Published by gustavohenke about 3 years ago

  • #1061, #1059 - allow using readonly arrays in TypeScript
express-validator -

Published by gustavohenke over 3 years ago

  • #1047, #1049 - make withMessage actually override a custom validator's message
  • #1026, #1037 - add missing arguments of isAlphanumeric
express-validator -

Published by gustavohenke over 3 years ago

  • #1034, #1035 - Fix publishing mistake with npm 7
express-validator -

Published by gustavohenke over 3 years ago

  • #995, #999 - Make oneOf() work imperatively
express-validator -

Published by gustavohenke over 3 years ago

  • #1001, #1004 - Updated dependencies
express-validator -

Published by gustavohenke over 3 years ago

  • #735, #871, #948 - add migration example from v5 to v6
  • #822, #974, #976 - add ability to run oneOf() imperatively
  • #822, #977 - add ability to run checkSchema() imperatively
  • #975 - fix objects whose toString property is not a function
  • #882, #978 - add isObject validator
  • #986, #987 - TypeScript - make isURL accept non-standard protocols

big kudos to @fedeci for the many improvements! 🎉

express-validator -

Published by gustavohenke almost 4 years ago

  • #973 - TypeScript - republish of v6.9.1 without the source .ts files
express-validator -

Published by gustavohenke almost 4 years ago

  • #963 - TypeScript - Updated signature of isAlpha() to work again with the underlying validator
express-validator -

Published by gustavohenke almost 4 years ago

  • #848, #851 - Add support for bail in schemas
express-validator -

Published by gustavohenke almost 4 years ago

  • #963 - TypeScript - Update IsAlphaOptions#ignore to allow RegExps, in addition to string[]
express-validator -

Published by gustavohenke almost 4 years ago

  • #958, #959 - Upgrade validator to ^13.5.2
Package Rankings
Top 0.58% on Npmjs.org
Badges
Extracted from project README
npm version Build status Coverage Status
Related Projects