All Versions
Latest Version
Avg Release Cycle
32 days
Latest Release
572 days ago

Changelog History
Page 2

  • v7.0.0-beta.0 Changes

    September 23, 2020

    The main changes

    • ๐Ÿ‘€ to reduce the mistakes in JSON schemas and unexpected validation results, strict mode is added - it prohibits ignored or ambiguous JSON Schema elements. See Strict mode and Options for more details
    • ๐Ÿ“„ to make code injection from untrusted schemas impossible, code generation is fully re-written to be type-level safe against code injection via untrusted schemas.
    • to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas.
    • ๐Ÿ‘ schemas are compiled to ES6 code (ES5 code generation is supported with an option).
    • to improve reliability and maintainability the code is migrated to TypeScript.

    Please note :

    • ๐Ÿšš the support for JSON-Schema draft-04 is removed - if you have schemas using "id" attributes you have to replace them with "$id" (or continue using version 6 that will be supported until 02/28/2021).
    • ๐Ÿ“ฆ all formats are separated to ajv-formats package - they have to be explicitly added if you use them.

    ๐Ÿ‘ Better TypeScript support:

    • ๐Ÿ‘€ Methods compile and compileAsync now return type-guards - see Getting started.
    • Method validate is a type-guard.
    • ๐Ÿ‘ Better separation of asynchronous schemas on type level.
    • ๐Ÿ‘ Type utility JSONSchemaType that generates the type for JSON Schema for type interface in the type parameter - it simplifies writing schemas (no unions support at the moment).

    API changes:

    • โž• addVocabulary - NEW method that allows to add an array of keyword definitions.
    • โž• addKeyword - keyword name should be passed as property in definition object, not as the first parameter (old API works with "deprecated" warning). Also "inline" keywords support is removed, code generation keywords can now be defined with "code" keyword - the same definition format that is used by all pre-defined keywords
    • Ajv no longer allows to create the instance without new keyword (it is ES6 class).

    โž• Added options (and defaults):

    • strict: true - strict mode
    • ๐Ÿ‘€ strictTypes: "log" - prevent mistakes related to type keywords and keyword applicability (see Strict Types)
    • ๐Ÿ‘€ strictTuples: "log" - prevent incomplete tuple schemas (see Prohibit unconstrained tuples)
    • ๐Ÿ‘ allowUnionTypes: false - allow multiple non-null types in "type" keyword
    • ๐Ÿ‘ allowMatchingProperties: false - allow overlap between "properties" and "patternProperties" keywords
    • loopEnum: Infinity - optimise validation of enums, similar to loopRequired
    • validateFormats: true - enable format validation

    ๐Ÿ”„ Changed options:

    • ๐Ÿ—„ keywords - now expects the array of keyword definitions (old API works with "deprecated" warning)

    โœ‚ Removed options:

    • ๐Ÿšš errorDataPath - was deprecated, now removed.
    • ๐Ÿ“ฆ format - validateFormats: false can be used instead, old format mode can be chosen via ajv-formats package.
    • 0๏ธโƒฃ nullable: nullable keyword is supported by default.
    • ๐Ÿ—„ jsonPointers: JSONPointers are used to report errors by default, jsPropertySyntax: true (deprecated) can be used if old format is needed.
    • ๐Ÿ—„ extendRefs: $ref siblings are validated by default (consistent with draft 2019-09), ignoreKeywordsWithRef (deprecated) can be used instead to ignore $ref siblings.
    • ๐Ÿ‘ป missingRefs: now exception is always thrown. Pass empty schema with $id that should be ignored to ajv.addSchema.
    • ๐Ÿ–จ processCode: replaced with code: {process: (code, schemaEnv: object) => string}.
    • sourceCode: replaced with code: {source: true}.
    • ๐Ÿšš schemaId: removed, as JSON Schema draft-04 is no longer supported.
    • 0๏ธโƒฃ strictDefaults, strictKeywords, strictNumbers: it is default now, controlled with strict.
    • uniqueItems: '"uniqueItems" keyword is always validated.
    • unknownFormats: the same can be achieved by passing true for formats that need to be ignored via ajv.addFormat or formats option.
    • cache and serialize: Map is used as cache, schema object as key.
  • v7.0.0-alpha.1 Changes

    September 17, 2020

    ๐Ÿš€ Pre-release - please ignore

  • v7.0.0-alpha.0 Changes

    September 15, 2020

    ๐Ÿš€ Pre-release of Ajv v7-beta version that is due end of September.

    ๐Ÿš€ Unless you want to experiment with the new version, it is recommended to continue using v6 until the following releases with proper release notes.

    ๐Ÿš€ This release is needed to update related package(s).

  • v6.12.6 Changes

    October 10, 2020

    ๐Ÿ›  Fix performance issue of "url" format.

  • v6.12.5 Changes

    September 13, 2020

    ๐Ÿ›  Fix uri scheme validation (@ChALkeR).
    ๐Ÿ›  Fix boolean schemas with strictKeywords option (#1270)

  • v6.12.4 Changes

    August 15, 2020

    ๐Ÿ›  Fix: coercion of one-item arrays to scalar that should fail validation (failing example).

  • v6.12.3 Changes

    July 04, 2020

    Pass schema object to processCode function
    Option for strictNumbers (@issacgerges, #1128)
    ๐Ÿ›  Fixed vulnerability related to untrusted schemas (CVE-2020-15366)

  • v6.12.2 Changes

    April 19, 2020

    โœ‚ Removed post-install script

  • v6.12.1 Changes

    April 18, 2020

    ๐Ÿ“„ Docs and dependency updates

  • v6.12.0 Changes

    February 22, 2020

    ๐Ÿ‘Œ Improved hostname validation (@sambauers, #1143)
    Option keywords to add custom keywords (@franciscomorais, #1137)
    ๐Ÿ›  Types fixes (@boenrobot, @MattiAstedrone)
    ๐Ÿ“„ Docs: