Packages

ata-validator

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

Your version

1.51.0

11 Oct 2026Where it was published

1.61.3 is the newest release of 1.x.

In short

5 new2 fixed

Release note

Schemas that reference each other now build. A schema whose $ref leads into another input used to be skipped by ata build; it is now built against the others, and with --mode schema the schemas are written once to a shared registry that keeps only the definitions the modules reach. --base-uri names shared files that declare no $id, such as the definitions file Kubernetes schemas reference.

Measured on an Apple M4 Pro, Node 25.2.1, minified with esbuild, gzipped: eight Kubernetes kinds go from not built to 32.6 KB as schema modules (68.6 KB self-contained), and the 19 browser validators of a project with 64 schemas that reference each other 1124 times come to 63.6 KB (273.6 KB self-contained). Verdicts match another validator on 15,348 Kubernetes and 59,724 project document pairs, and error lists match the runtime Validator. Against 1.50.0: require, first check, hot paths and a Fastify app's first request are within noise; the browser bundle is 0.48 KB larger; reading the errors of a validator with the schemas option costs 2 to 3% more, since those errors are now put in order rather than left as the engine emitted them.

Added

  • ata build builds schemas that reference each other by $id. A schema whose references leave it gets the other inputs registered beside it, as the schemas option would; one that resolves within itself is built as before. Such schemas used to be skipped as not AOT-compatible: on 64 schemas that reference each other 1124 times, 2 were built, now 63 are (the 64th holds only $defs).

  • With --mode schema those modules name their schema by $id, and the schemas are written once to ata-registry.mjs beside the runtime. For the 19 of those schemas one application builds browser validators for, that is 63.6 KB gzipped, minified, against 273.6 KB for self-contained modules, which each carry what they reference. The answers are the same: on 59,724 document and schema pairs from the project's fixtures, verdicts match the self-contained modules and another validator, and error lists match the runtime Validator. toSchemaModule(validator, { runtime, registry }) and registrySource(schemas) in ata-validator/aot do it by hand.

  • ata build --base-uri <uri> names every input without an $id by the URI and its file name, so schemas that reference a shared file by URL or relative path build. Kubernetes schemas reference one _definitions.json that declares no $id: none of them built before, now each does.

  • The schema registry keeps only the definitions its modules reach, after checking that every reference still resolves without the rest. For eight Kubernetes kinds it is 68.5 KB rather than 242.3 KB, and the eight modules with the registry and the runtime come to 32.6 KB gzipped, minified, against 68.6 KB for self-contained modules.

  • A schema skipped for a reference that does not resolve says which reference, and what would resolve it, instead of "not AOT-compatible".

Fixed

  • Errors behind a $ref into another document (the schemas option, addSchema) are ordered as they would be inline. The ordering followed only references within the root, so the generated code and the interpreter each kept their own order and disagreed: required before additionalProperties from one, after the nested property errors from the other.

  • ata build prints its warnings. A module whose error detail the generator declined reported every failure as the single ATA9000 error and the build said nothing; it now says so for each such module and points to --mode schema.