Packages

ata-validator

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

Upgrading ata-validator from 1.52.0 to 1.53.0

1 release in betweenevery note read

Reading releases, release notes and advisories…

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

Release by release

  1. 1.53.0

    11 Oct 20263 new · 5 fixes
    • new

      Custom keywords can ask for their data's context with dataContext: true: the per-value function is also given { instancePath, parentData, parentDataProperty, rootData }, as the default validator's keywords are, so it can read or remove the value where it sits. A schema using one runs on the interpreted engine's collecting walk, which knows where every value is; other schemas are untouched. ata-validator/compat gives every keyword this context and it.schemaPath, which is what express-openapi-validator's readOnly and writeOnly keywords use to strip read-only properties from a request.

    • new

      ata-validator/compat takes what a library sets up on it in its own code: the formats plugin's addFormats() is accepted and registers its formats as the reference does, a keyword registered under a list of names is registered under each, and a draft-04 schema (OpenAPI 3.0's meta-schema) is read as draft-07 with its id as $id and checked against draft-07's meta-schema after its boolean bounds are normalized. A keyword defined only as generated code is now refused when a schema uses it rather than when it is registered, so a library that registers such a keyword for an option it may not use can take the class. With these, express-openapi-validator runs on compat with one change of its own (a portable x-eov-type) and validates requests against GitHub's and Stripe's API descriptions, which the default validator cannot load.

    • new

      ata-validator/compat does what the reference does while it validates, for the schemas that need it. coerceTypes converts a value where each type is checked, so it reaches values behind anyOf, oneOf, allOf and $ref; useDefaults fills defaults behind allOf and $ref; the discriminator option applies the oneOf branch the tag names; a schema registered under a fragment-only key such as #/components/schemas/Pet is found by a $ref of that string; a format registered with type: 'number' is checked on numbers; and custom keywords take before and post to order keywords that change the data. Errors name the schema a $ref points to, and oneOf and anyOf with no passing branch use the reference's wording. express-openapi-validator's own suite, run with ata injected through a small factory option, passes 470 of 470, as it does on the default validator; it passed 429 before these. On 2400 generated documents with composition and coerceTypes: true, verdicts and coerced data match the reference in every case. A schema keeps its compat copy across compiles, so the work done once per shared schema is not done again: with express-openapi-validator on Stripe's API description, the first request on a second route went from 280 to 200 ms, and the first request overall stays at 1.1 s on both Stripe's and GitHub's.

    • fixed

      A declared property whose value is undefined gave different answers on different engines: the generated code skipped it, as the default validator does, and the interpreted engine and the closures used where code generation is blocked checked it and rejected. All of them now skip it. No JSON document carries such a value, but an object about to be serialized often does ({ id: req.params.id } with no such parameter). tests/test_undefined_property.js holds the engines together.

1 internal line (docs, tests, tooling) left out.