Back to Explore

ajv-validator/ajv-keywords

GitHub
1 watchersOpen source

Last release:

Adds custom JSON-Schema keywords to the Ajv JSON validator, extending what schemas can express. Useful if you need extra validation or schema “keyword” features beyond Ajv’s built-in keywords, such as type checks and additional constraints.

Project status

  • The repository appears largely dormant: the last upstream push was 2023-04-17, and the newest listed version is v5.1.0 from 2021-11-21, so it does not show active maintenance as of 2026-08-12.
  • Update cadence is very low based on the provided history (v4.0.1 in 2021-03, v5.0.0 in 2021-03, v5.1.0 in 2021-11), followed by a long gap with no evidence of recent changes.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v5.1.0

    v5.1.0 refines how the `regexp`, `patternRequired`, and `transform` keywords compile and handle RegExp flags and schema mutation. The release fixes incorrect RegExp caching behavior (especially around Unicode flag handling) and ensures the `transform` keyword does not mutate the original schema during compilation.

  • v5.0.0

    This release upgrades ajv-keywords to support Ajv v8 and marks the `select` keyword family as deprecated, advising use of the OpenAPI `discriminator` keyword. The code changes are small, but there is at least one substantive internal change in how equality is computed for `uniqueItemProperties`.

    Breaking
  • v4.0.1

    Release v4.0.1 provides a targeted fix for Ajv-keywords' `select` keyword when the selector value is non-string (for example, boolean values). The update adjusts the internal comparison logic so `selectCases` keys are matched reliably against selector values.

  • v5.0.0-beta.1

    v5.0.0-beta.1 updates the project to use newer Ajv and ajv-formats beta versions and swaps the deep equality implementation used by the uniqueItemProperties definition. The code change replaces an internal Ajv equality import with fast-deep-equal.

  • v5.0.0-beta.0

    v5.0.0-beta.0 upgrades the package to work with Ajv v8. The release notes only mention the Ajv upgrade, with no other behavioral or export changes described.

    Breaking
  • v4.0.0

    v4.0.0 finalizes Ajv v7 compatibility (moving off the rc line) and includes major keyword behavior updates described in the release notes, including reworked select/transform support and updated metaschema handling. The provided code diff is small and mostly shows internal TypeScript import path and build/publish workflow adjustments, with only minor changes in keyword implementation files.

    BreakingFeatures
  • v4.0.0-rc.0

    This release focuses on introducing explicit AJV error object types for specific keywords, and exporting a consolidated error union type. In addition to the type work, the package metadata is updated to target a newer AJV release candidate.

    Features
  • v4.0.0-beta.3

    Release v4.0.0-beta.3 focuses on improving how this package works with Ajv standalone validation code. The code changes specifically adjust the `transform` keyword definition to generate standalone-safe code, and the test suite is expanded to cover standalone scenarios.

    Features
  • v4.0.0-beta.2

    v4.0.0-beta.2 updates how this package references JSON Schema meta-schemas (switching to the newer json-schema.org "latest" URI) and introduces a new Ajv keyword implementation for the `transform` keyword. The code diff shows additional packaging and Ajv compatibility changes beyond what the release notes explicitly call out.

  • v4.0.0-beta.1

    v4.0.0-beta.1 adds support for Ajv unevaluatedProperties and unevaluatedItems when using the custom select keyword. It also bumps the package peer dependency on Ajv v7 beta and adds tests to cover the new unevaluated behavior.

    Features