Releases: ajv-validator/ajv
3.0.0
v5 $data
reference to use values from the validated data as values for schema keywords.
New formats: uuid
, json-pointer
, relative-json-pointer
.
Option loopRequired
to limit the size of compiled validation function in case of very large number of required properties.
Improved macro keywords:
- simpler code and faster compilation.
- macro keyword adds the error.
- macro keyword can be limited to some data type(s).
npm run bundle
now creates minified UMD browser bundle with source map.
Changes
Previously Ajv was compiling "required" keyword as if the option loopRequired
was set to 21. Currently the default value is Infinity
(better performance but larger validation function in case of many required properties).
Function for inline
keyword receives keyword as the second parameter. See Inline keywords.
Errors for custom keywords now have actual keyword in error.keyword
property (previously "custom"
).
2.5.0
schemaPath
in errors.
2.4.0
switch
keyword from from JSON-schema v5 proposals.
v5 meta-schema used by default with option v5.
2.3.0
Added parentSchema
property to error option when option verbose
is true.
2.2.0
time
format
formatMaximum
/formatMinimum
and exclusiveFormatMaximum
/exclusiveFormatMinimum
from JSON-schema v5 proposals with option v5
2.1.0
patternGroups
keyword from v5 proposal (with option v5: true
)
schemaPath
property in errors (only JavaScript notation)
Fix of inlining remote refs
2.0.0
Defining custom keywords with ajv.addKeyword()
(4 types of keywords: validate, compile, macro and inline).
Keywords constant
and contains
from JSON-schema v5 proposals with option v5: true
.
Now dataPath
in errors for keywords required
and additionalProperties
points to object (previously it pointed to offending property). The new behaviour is consistent with the data being validated and also with optional data
property in errors. Offending property is available in error params
(missingProperty
or additionalProperty
).
With option errorDataPath: 'property'
dataPath
in errors for keywords required
, additionalProperties
and dependencies
points to offending property. Until version 2.0.0 it was default behaviour for keywords required
and additionalProperties
.
.params
property of error objects changed for some keywords. See Error parameters.
For i18n messages version >=1.0.0 of ajv-i18n should be used.
Option i18n
is removed, error parameters are available and i18n messages can be used without this option.
Upgrading from previous version
If you used dataPath
of errors for keywords required
and additionalProperties
you may need to use option errorDataPath: 'property'
.
If you used .params
of errors you may need to update your code.
You can remove option i18n
.