Releases: ajv-validator/ajv
v8.0.1
Typescript: export function getData
(for ajv-errors)
v8.0.0
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 withinstancePath
- "should" replaced with "must" in the messages
- property name is removed from "propertyName" keyword error message (it is still available in
error.params.propertyName
).
v7.2.4
v8.0.0-beta.4
Revert the change for strict mode options in v8.0.0-beta.1 to allow overrides to disable some options, not only to enable.
These strict mode options are available:
strictSchema - new, equivalent to strict: true
in v7, default true
strictNumbers - reinstated from v6, but with default true
strictTypes - same as in v7, default "log"
strictTuples - same as in v7, default "log"
strictTuples - same as in v7, default false
Option strict
sets all options above to the same value.
v8.0.0-beta.3
JSON Schema draft2012-12 support - prefixItems
, new semantics of items
, dynamicRef
and dynamicAnchor
Fixes:
v7.2.3
Remove docs from npm package
v7.2.2
Docs correction
Simplified JSONSchemaType (@erikbrinkman)
Fix #1493 - incorrect reporting of missing required property with option ownProperties: true
Fix #1501 - JTD not working correctly with many properties in the schema
v8.0.0-beta.2
OpenAPI discriminator keyword
v8.0.0-beta.1
Support for union types in JSONSchemaType (#1302, @erikbrinkman).
More ergonomic Ajv constructor export - no need to use .default
in .js
and .mjs
files (#1381).
Remove circular dependencies (#1399).
New syntax for strict
option (#1392). It can now be used as boolean/"log" (to set all strict mode restrictions) or as an object with properties schema
, number
, types
, tuples
and required
, the defaults are:
{
schema: true,
number: true,
types: "log",
tuples: "log",
required: false
}
Options strictTypes, strictTuples and strictRequired removed.
v8.0.0-beta.0
JTD error objects:
schemaPath
andinstancePath
are consistent with JSON Type Definition RFC- added properties
keyword
andparams
,message
(can be removed withmessages: false
option) to error objects
JTD error messages can be translated with ajv-i18n v4.0.0-beta.0 - typescript: discriminated union type for JTD errors for type-safe error handling, errors need to be cast to
JTDErrorObject
type.
JSON Schema errors:
dataPath
property replaced withinstancePath
(update in your code!)- "should" replaced with "must" in the messages
- property name is removed from "propertyName" keyword error message (it is still available in
error.params.propertyName
).