Packages

ata-validator

1.61.3 · 29 Oct 2026MIT21.8k / weekRepositoryHomepagenpmAtom feed

Your version

1.16.0

12 Sep 2026Where it was published

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 a validate(value, data, parentSchema) function, a compile(value, parentSchema) factory, or a macro(value, parentSchema) that returns a schema applied in place. A definition can name the JSON Schema type it applies to. A schema that uses a registered keyword runs on the interpreted engine, so anyOf, not, $ref and 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/compat covers the reference class's surface: compileAsync, removeSchema, validateSchema against the vendored meta-schemas, addFormat in its four forms, addKeyword in the validate, compile and macro forms plus the bare-name form, addVocabulary, getKeyword, removeKeyword, errorsText, addMetaSchema, ajv.errors and ajv.opts; and the constructor options allErrors, useDefaults (off by default, as in the reference), coerceTypes, removeAdditional, verbose, validateFormats, validateSchema, formats, keywords and schemas. A schema with no $schema is 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 anyOf or oneOf, each bad property name with its own errors and a propertyNames error, items before contains and an if error after a failed then/else under allErrors, draft-07 dependencies named as such, and with allErrors off the first failing keyword's whole group. tests/test_ajv_parity.js runs 32 scenarios of real consumer call shapes through both implementations and compares the results field by field.

Changed

  • ata-validator/compat refuses what it cannot honour instead of accepting it: $data: true throws at construction, a code-only keyword throws at addKeyword, 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.