Packages

ata-validator

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

Upgrading ata-validator from 1.22.0 to 1.22.1

1 release in betweenevery note read

Reading releases, release notes and advisories…

Other targets from 1.22.0Newest 1.x, Latest1.61.3
0
changes to make
0
advisories fixed
0
new
3
fixes

Release by release

  1. 1.22.1

    16 Sep 20263 fixes
    • fixed

      validateJSON() did not return on a document that ends inside an array. validateJSON('[') was one byte, any schema, the default configuration, and it never came back. On a rejection the error carries a caret, so a map from pointer to position is built from the raw text; its array loop asked for the next element without checking that the input had ended, walk returned without moving, and nothing else could close the array. '[}' hung the same way, because a character that begins no value leaves the position where it was. The object loop escaped only by accident: an unterminated string throws, and lib/data-position-cache.js catches throws. It cannot catch a loop. Both container loops now stop at the end of the input, and the array loop stops when an iteration does not advance, so a truncated document still yields a map of what was there.

    • fixed

      unevaluatedProperties: false reported the boolean schema underneath the keyword instead of the keyword itself: keyword: 'not', empty params, and an instancePath pointing at the offending member rather than the object holding it. Nothing in that error said which key was unexpected, so a caller branching on params.unevaluatedProperty to flag unknown keys saw nothing at all. It now reports unevaluatedProperties on the object, with params.unevaluatedProperty naming the key, one error per key. unevaluatedItems: false had the same shape and now reports one error for the array, with params.limit at the first unevaluated position. Both engines were changed together and tests/test_unevaluated_error_shape.js holds them to it. Reported by a config linter reading err.params.unevaluatedProperty through ata-validator/compat.

    • fixed

      verbose: true attached only parentSchema. It now also attaches data, the value the error points at, and schema, the failing keyword's own value, which is the whole set the option is supposed to carry. Without data a caller had to walk the document by the instance path itself. The default error shape is unchanged: the two fields appear only when verbose is on, including on the errors ata-validator/compat synthesises for an if wrapper.

1 other line we could not sort, mostly version bumps
  • additionalProperties: false no longer compiles to a comparison per declared name. It was one comparison per name per key of the document, which is quadratic in the number of properties: a 1000-property schema spent 75 µs on a document where the same schema without the keyword took 3, and doubling the properties quadrupled that. Above 128 declared names the generated code now reads a name lookup built once per compiled function; below that the comparison chain stays, because it allocates nothing and the two are the same within noise there.

    1.22.1