Custom JSON Schema keywords for the Ajv validator (v8). Current stable version 5.1.0, released regularly on npm. Provides additional validation keywords like typeof, instanceof, range, regexp, transform, uniqueItemProperties, allRequired, deepProperties, and select. Requires Ajv v8.8.2+ peer dependency. Ships TypeScript definitions. Commonly used to extend JSON Schema validation beyond the standard spec, especially for instance validation and dynamic defaults.
npm install ajv-keywordsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows adding all keywords to Ajv, then using typeof and instanceof keywords in schemas.
Upgrade Ajv to v8.8.2 or later, or use ajv-keywords v3 with Ajv v6.
Use JSON Schema if/then/else instead of select where possible.
Do not use these keywords when generating standalone validation code with Ajv's standalone module.
Avoid using instanceof for cross-realm validation; use typeof or custom keyword instead.
Use import ajvKeywords from 'ajv-keywords' and call ajvKeywords(ajv).
Use import ajvKeywords from 'ajv-keywords' (ESM) or const ajvKeywords = require('ajv-keywords').default (CJS with ESM interop)npm install ajv-keywords@^5.0.0 for Ajv v8, or ajv-keywords@^3.5.2 for Ajv v6
Ensure schema value is a string constructor name (e.g., 'RegExp', 'Array'), not an object or literal