-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Summary
The major changes of this release are that it breaks a few elements of the error details (which people might not even be using), and the isemail dependency has been updated to latest.
There was also a massive effort to better test those error details from now on, hopefully it will help us get better in this area in the future versions.
- Upgrade time: moderate
- Complexity: low
- Risk: moderate
⚠️ Breaking changes
Error details and language
details
path
Error details have changed slightly to now report error paths as arrays to disambiguate paths containing dots, no more unsafe splitting!
If you miss the old format you can always use path.join('.').
context
The context of the details errors will from now on contain a key that is always the key of the element (or undefined for the root) and label which is either the key, or the label if you defined one, or language.root of the predefined language (so 'value' by default).
key and language messages
Language messages have gone from using key to label as decribed in the previous section. So if you either overridden the key by setting language.key or changed the messages containing {{key}} or {{!key}} or any variation of it, you should now use {{label}} or {{!label}} instead.
Joi.string().isoDate() conversion
This validation, if used with convert set to true (which is the default), will now format your string to a uniform ISO format (javascript's) instead of letting it like it was.
You probably won't care about that new behavior, but if you do you can still use Joi.string().isoDate().raw() to get back the raw value that was passed to joi.
Support IPv6 with CIDR > 32
This is more of a bugfix, but if you were relying on this behavior, make sure it's not a problem for you. (see #1232)
isemail major upgrade
isemail is now updated to 3.x.x. The breaking change is that it now supports RFC 6530 which cannot be disabled for now. I'd advise you to carefully check that those kind of e-mails won't be a problem in your system afterwards. An option to disable that RFC will eventually make it into isemail, if you want it to happen I'd encourage you to contribute.
Side-effect for the webpack users is that we've lost use of the dns module in it, so one less thing to worry about.
✨ New features
Joi.defaults()
This new API allows you to set defaults on the schemas you create, per-type if necessary.
I encourage you to have a look at the documentation to have a better understanding of the feature.
👥 Contributors
The contributors to this release are @WesTyler, @DavidTPate, @bdgamble and myself.