Releases: ata-core/fastify-ata
Release list
v0.6.0
Requires ata-validator@^0.20.0 for the new chainable builder at ata-validator/t. README shows the TypeBox-style authoring path on a Fastify route, and test-t-builder.js pins the contract end-to-end so future ata bumps cannot silently break the migration.
v0.5.0
Requires ata-validator 0.18.0, whose Infer resolves anyOf/oneOf to unions, allOf to an intersection, prefixItems to tuples, and local $ref.
Request bodies now narrow to those shapes through AtaTypeProvider with no manual annotation. Type tests cover the union, the referenced type, and the intersection cases. No code change to the provider itself: it builds on Infer and inherits the wider inference.
v0.4.2
Fixed
- The plugin now passes schemas registered via
fastify.addSchemato ata, so cross-schema$ref(e.g.{ $ref: 'shared#' }) resolves through theregister(fastifyAta)path. Previously the validator was built without external schemas, so any addSchema reference failed withcannot resolve $ref. Both external$idrefs and draft-07#anchorrefs are now resolved and enforced.
Changed
- Requires
ata-validator^0.17.5(draft-07 plain-name anchor resolution).
v0.4.0
TypeScript type provider and ata-validator 0.17.
AtaTypeProvider: useFastify().withTypeProvider<fastifyAta.AtaTypeProvider>()and author route schemas withdefineSchema(...)from ata-validator, andrequest.body/request.query/request.paramsare typed from the schema with no manual annotation. Plain JSON Schema, no builder DSL. Type-level only.- Bumped to
ata-validator@^0.17.0(cross-schema$ref, nullable, coerceTypes array, and the validateAndParse fix). prettyErrorsoption renders compiler-grade error messages (ATA code + did-you-mean) in 400 responses.
v0.3.0
Aligned with ata-validator@0.11.0 / 0.11.1.
Added
abortEarlyoption passes through to the validator. On failure the plugin returns a shared stub result instead of running the detailed error collector. On a 10-property schema the invalid path drops from roughly 15 ns/op to 3.7 ns/op. Useful for high-throughput route guards that only need accept / reject.
fastify.register(require('fastify-ata'), {
coerceTypes: true,
removeAdditional: true,
abortEarly: true,
})Fixed
- Removed an accidental self-dependency (
fastify-atadepending onfastify-ata) inpackage.json. - Dropped the
turbooption from the type declarations — it was never implemented in the current surface.
Docs
Updated README with the numbers verified against ata-validator@0.11.x on M4 Pro / Node 25:
- Fastify pipeline: tied on valid, +3% on invalid
- Serverless cold start (10 routes, first request): 12.4 ms → 0.5 ms (~24x)
abortEarlyinvalid path: 4x
Added a section on the new ata compile CLI for browser / edge deployments.
Install
npm install fastify-ata@0.3.0