Skip to content

Releases: ajv-validator/ajv

3.0.0

27 Dec 22:03
Compare
Choose a tag to compare

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

19 Dec 19:07
Compare
Choose a tag to compare

schemaPath in errors.

2.4.0

12 Dec 22:05
Compare
Choose a tag to compare

switch keyword from from JSON-schema v5 proposals.
v5 meta-schema used by default with option v5.

2.3.0

11 Dec 21:44
Compare
Choose a tag to compare

Added parentSchema property to error option when option verbose is true.

2.2.0

05 Dec 21:30
Compare
Choose a tag to compare

time format
formatMaximum/formatMinimum and exclusiveFormatMaximum/exclusiveFormatMinimum from JSON-schema v5 proposals with option v5

2.1.0

28 Nov 15:10
Compare
Choose a tag to compare

patternGroups keyword from v5 proposal (with option v5: true)
schemaPath property in errors (only JavaScript notation)
Fix of inlining remote refs

2.0.0

22 Nov 01:23
Compare
Choose a tag to compare

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.

1.4.10

17 Nov 20:48
Compare
Choose a tag to compare

Fixed peerDependency for ajv-i18n
This and earlier versions of ajv require version 0.1.1 of ajv-i18n
Future ajv versions (>=2.0.0) will require version >= 1.0.0 of ajv-18n

1.4.9

07 Nov 14:01
Compare
Choose a tag to compare

Fixed remote ref resolution for local hash ref with remote hash ref that has inner hash ref (e.g. swagger api schema), issue #70

1.4.8

25 Oct 22:20
Compare
Choose a tag to compare

Improved uri format to allow relative URIs and URNs (#59).
Fixed email format.
Fixed reference resolution in cases of scope change.
Improved validation performance.