Packages

ata-validator

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

Your version

1.30.1

24 Sep 2026Where it was published

1.61.3 is the newest release of 1.x.

Release note

A correctness fix for a shape that has been wrong since 1.27.1.

A $defs entry that is both self-recursive and carries additionalProperties: false made the code generator reject valid documents:

const schema = {
  $defs: { f: { type: 'object', properties: { not: { $ref: '#/$defs/f' } }, additionalProperties: false } },
  type: 'object',
  properties: { id: { anyOf: [{ type: 'integer' }, { $ref: '#/$defs/f' }] } },
}

new Validator(schema).validate({ id: 1 })   // false, where the interpreted engine says true

additionalProperties is held back to the end of the emitted function, because the body optimizes better when the key walk is last. The list it waits in hung off the whole compile rather than the one function, and a def on a $ref cycle is emitted as a function of its own, so the def's key set was flushed into whichever function was being compiled. The root above ended up walking its own keys against the def's list and refused id for not being not.

The combined generator never flushed that list at all, which drops the constraint rather than misplacing it. Modules built with ata build carry the same fault, since they go through the same generator. A def now keeps its own list for the length of its own body.

The engine differential had the blind spot that let this ship. Its corpus had $defs, and it had additionalProperties, but never the two crossed with recursion. The shape is in the corpus now, and without the fix it splits the two engines on 30 of 21168 cases.

Draft 2020-12 1301 of 1301, draft 7 929 of 929, the v1 dialect 1135 of 1135, identical with code generation blocked.