ata-validator
1.61.3 · 29 Oct 2026MIT21.8k / weekRepositoryHomepagenpmAtom feed
1.61.3 is the newest release of 1.x.
In short
3 new1 changed
Release note
Added
Custom keywords.
new Validator(schema, { keywords: { name: definition } })registers keywords with avalidate(value, data, parentSchema)function, acompile(value, parentSchema)factory, or amacro(value, parentSchema)that returns a schema applied in place. A definition can name the JSON Schematypeit applies to. A schema that uses a registered keyword runs on the interpreted engine, soanyOf,not,$refand the other applicators keep their meaning around the custom check; the compiled engines, the tier-0 plan and the native walker are routed away from such schemas, and the AOT emitters refuse them instead of emitting a module that would ignore the keyword. See docs/custom-keywords.md.ata-validator/compatcovers the reference class's surface:compileAsync,removeSchema,validateSchemaagainst the vendored meta-schemas,addFormatin its four forms,addKeywordin thevalidate,compileandmacroforms plus the bare-name form,addVocabulary,getKeyword,removeKeyword,errorsText,addMetaSchema,ajv.errorsandajv.opts; and the constructor optionsallErrors,useDefaults(off by default, as in the reference),coerceTypes,removeAdditional,verbose,validateFormats,validateSchema,formats,keywordsandschemas. A schema with no$schemais read as draft-07.The shim reports errors in the reference's shape and order: keywords in evaluation order rather than declaration order, the failing branches before an
anyOforoneOf, each bad property name with its own errors and apropertyNameserror, items beforecontainsand aniferror after a failedthen/elseunderallErrors, draft-07dependenciesnamed as such, and withallErrorsoff the first failing keyword's whole group.tests/test_ajv_parity.jsruns 32 scenarios of real consumer call shapes through both implementations and compares the results field by field.
Changed
ata-validator/compatrefuses what it cannot honour instead of accepting it:$data: truethrows at construction, acode-only keyword throws ataddKeyword, and the reference's formats plugin throws with a note that its formats are built in.
Suite: Draft 2020-12 1299 of 1299, draft 7 927 of 927, v1 1133 of 1133, identical with code generation blocked.