Skip to content

v8.0.0

Compare
Choose a tag to compare
@epoberezkin epoberezkin released this 27 Mar 12:39
· 295 commits to master since this release

This document describes changes from v7.2.4 to v8.0.0.

If you are migrating from v6 you can use this document.

New features

Support JSON Schema draft-2020-12: prefixItems keyword and changed semantics of items keyword, dynamic recursive references.
OpenAPI discriminator keyword.
Improved JSON Type Definition support:

  • errors consistent with JTD specification.
  • error objects with additional properties to simplify error handling (see Error objects)
  • internationalized error messages with ajv-i18n
    TypeScript: support type unions in JSONSchemaType

Other changes / improvements

Node.js require works without .default property - see examples in Getting started
Reduce runtime dependency for standalone validation code
Fix resolution of $ref: "#" when $id is present (#815)

Breaking changes

Option strict controls all strict mode restrictions
JSON Schema validation errors changes:

  • dataPath property replaced with instancePath
  • "should" replaced with "must" in the messages
  • property name is removed from "propertyName" keyword error message (it is still available in error.params.propertyName).