Skip to content

4.0.0 #254

@hueniverse

Description

@hueniverse

Removed:

  • validateCallback() - use validate() on compiled schema
  • any().rename() - use object().rename()
  • rename() move option - use alias set to true
  • modify option - the input value is no longer modified, just the return value
  • with(), without(), xor(),or()from all types exceptobject`
  • error.simple() - error.message is set to simple string automatically and doesn't change.
  • error.annotated()

Changed:

  • validation no longer changes the input value, and returns the modified value via the validate callback.
  • validate() requires a new callback argument
  • schema.validate() no longer supports options - use Joi.validate() to override the default options.
  • rename() deletes old key by default
  • with(), without() now require the name of the key they apply to and all other peers must be provided in a single array.
  • or() and xor() are no longer bound to a specific key but to all the listed peers together.
  • various error messages.
  • error.annotate() returns the verbose message without changing the error itself.
  • alternatives using the [] notation now allow undefined by default (defaulted to required before).
  • complete rewrite of the errors language template and context

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions