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…
- 0
- changes to make
- 0
- advisories fixed
- 0
- new
- 3
- fixes
Release by release
- 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,walkreturned 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, andlib/data-position-cache.jscatches 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: falsereported the boolean schema underneath the keyword instead of the keyword itself:keyword: 'not', emptyparams, and aninstancePathpointing at the offending member rather than the object holding it. Nothing in that error said which key was unexpected, so a caller branching onparams.unevaluatedPropertyto flag unknown keys saw nothing at all. It now reportsunevaluatedPropertieson the object, withparams.unevaluatedPropertynaming the key, one error per key.unevaluatedItems: falsehad the same shape and now reports one error for the array, withparams.limitat the first unevaluated position. Both engines were changed together andtests/test_unevaluated_error_shape.jsholds them to it. Reported by a config linter readingerr.params.unevaluatedPropertythroughata-validator/compat. - fixed
verbose: trueattached onlyparentSchema. It now also attachesdata, the value the error points at, andschema, the failing keyword's own value, which is the whole set the option is supposed to carry. Withoutdataa caller had to walk the document by the instance path itself. The default error shape is unchanged: the two fields appear only whenverboseis on, including on the errorsata-validator/compatsynthesises for anifwrapper.
- fixed
1 other line we could not sort, mostly version bumps
- 1.22.1
additionalProperties: falseno 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.