@epoberezkin epoberezkin released this Nov 22, 2015 · 1029 commits to master since this release

Assets 2

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