ata-validator
1.61.3 · 29 Oct 2026MIT21.8k / weekRepositoryHomepagenpmAtom feed
Upgrading ata-validator from 1.42.0 to 1.43.0
1 release in betweenevery note read
Reading releases, release notes and advisories…
- 0
- changes to make
- 0
- advisories fixed
- 0
- new
- 4
- fixes
Release by release
- fixed
validateJSON()andisValidJSON()could abort the whole Node process on large schemas with many references to the same definitions, such as SchemaStore's traefik and detekt. The text scanner generated for such a schema came to 0.5 to 1 MB of source in one function, and V8's Maglev compiler aborted the process (raw_hash_map<>::at) while optimizing it, after about a hundred calls, in plain JavaScript on Node 24 and 25. It was intermittent, about half of the runs on those schemas. Affected: 1.30.0 to 1.42.0, measured on the published versions. The scanner is now emitted as one function where it fits in 64 KB and otherwise split into functions of bounded size, with large definitions and members called rather than repeated; the largest scanner function on SchemaStore went from 1 MB to 64 KB. Every one of the 980 SchemaStore schemas was run in its own process, with and without the native addon, with no failure. On traefik-v2 the split scanner is 1.47 times slower than parsing the text would be; on the six other schemas that split it is 1.0 to 2.3 times faster. - fixed
The compile cache and the preprocess cache were unbounded. They kept every schema's text and generated functions for the life of the process: after compiling each of the 975 SchemaStore schemas once and dropping the validators, 1247 MB stayed on the heap. Both caches now keep at most 128 entries, oldest out first, and the same run keeps 572 MB. A schema compiled again after its entry was dropped is compiled again.
- fixed
With both
$defsanddefinitionsat the root and the same name in both, generated code read#/definitions/xas$defs/x, so a document the schema accepts was rejected and one it rejects was accepted. Such a schema now runs on the interpreted engine, which resolves each pointer as written. Affected: every version from 0.6.0 to 1.42.0. None of the 980 SchemaStore schemas has both containers. - fixed
A property name holding a control character, such as a line break, broke the source of the function that validates and collects errors in one pass. Answers were right, but such a schema validated a rejected document twice every time its errors were read.
- fixed
12 other lines we could not sort, mostly version bumps
- 1.43.0
oneOfandanyOfcount their passing branches with verdict functions and run the branches that collect errors only when none passes; aoneOfmatched by more than one branch builds itsATA4002error from that count. - 1.43.0
Where
unevaluatedPropertiesis worked out at run time, its branch counts are reused byoneOfandanyOf, and each branch's validity is worked out once, bottom up. - 1.43.0
Recursive schemas, through
$ref: "#"or definitions on a reference cycle; - 1.43.0
unevaluatedItemswhose evaluated positions depend on which branches pass; - 1.43.0
A
$refbeside keywords that validate, such as{ "$ref": "#/$defs/n", "minimum": 5 }, which Draft 2020-12 applies together; it used to send the whole schema to the interpreted engine; - 1.43.0
Patterns with Unicode property escapes such as
\p{L}, compiled with the unicode flag as the interpreted engine compiles them; they used to send the whole schema to the interpreted engine. - 1.43.0
A definition referenced from several places is written once as a function and called at each reference, in the function that collects errors, and in the verdict function when its source would pass 64 KB. The first rejection with its errors read (16 calls, compiling included, plain JavaScript) takes 85 ms on SchemaStore's SARIF schema where it took 128 ms, 33 ms on cloud-run where it took 92 ms, and 40 ms on putout where it took 150 ms.
- 1.43.0
The text scanner behind
validateJSON()andisValidJSON()covers 85 of the 980 SchemaStore schemas, up from 62, now that it reads draft 7definitions, and finds long property names withindexOf. Over the 48 of those schemas with sample documents, each in its own process,validateJSON()takes 0.88 of the time it took, as a geometric mean. - 1.43.0
ata buildused to refuse a schema with a$refbeside a validating keyword. It now emits a module whose verdict applies both, withoutparseand with the singleATA9000abort-early error in place of detailed errors, and says so for each throughonWarning. - 1.43.0
The browser runtime bundle is 114.1 KB gzipped, up from 108.9 KB;