yarn ajv 8.0.0
v8.0.0

latest releases: 8.10.0, 8.9.0, 8.8.2...
3 years ago

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).

Don't miss a new ajv release

NewReleases is sending notifications on new releases.