Packages

ata-validator

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

Upgrading ata-validator from 1.6.2 to 1.7.0

1 release in betweenevery note read

Reading releases, release notes and advisories…

Other targets from 1.6.2Newest 1.x, Latest1.61.3
0
changes to make
0
advisories fixed
2
new
6
fixes

Release by release

  1. 1.7.0

    23 Aug 20262 new · 6 fixes
    • new

      validator.engine() reports which engine answers validate() for the schema: 'codegen', 'closure', 'native' or 'interpreter'. A diagnostic for startup logs and benchmarks. Measured over fourteen request-shaped schemas (body, params, query, shared $ref, oneOf, if/then, local $defs), thirteen take the generated path; patternProperties with additionalProperties: false is the one that goes to the interpreter.

    • new

      formatMode: 'inject' for toStandaloneModule, bundleStandalone, bundleCompact and build(). The output carries no custom format source; it exports setFormats(map) and looks each format up from that registry at validation time, with a named error if one is missing. This is for formats that cannot be serialized: functions that close over variables, bound functions, or code rewritten by coverage and transpile steps. The default 'embed' is unchanged in behavior, but it now checks each function's source at build time and throws with the format's name when it would not survive embedding, instead of emitting a module that fails on first use.

    • fixed

      The four code generation entry points disagreed with each other on 157 instances of the official suite. Most of it was the closure compiler, the boolean fallback behind isValidObject() when the code generator declines a schema: it ignored unevaluatedProperties and unevaluatedItems outright, treated a self-referencing $ref: "#" as always true, skipped additionalProperties whenever no properties map sat next to it, and passed strings in date-time, time, uri and duration format without checking them. Each of those accepted input it should have rejected. It now declines those schemas, so they reach an engine that handles them. The remaining disagreements were wrong rejections shared by both boolean paths: required, minProperties and maxProperties applied to non-objects, multipleOf had no tolerance for fractional divisors, const and enum compared objects by key order, and items started at index 0 when prefixItems was present. isValidObject() and validate() now agree on every suite instance.

    • fixed

      A dependentSchemas branch carrying additionalProperties: false had that check hoisted out of its condition to the top level of the compiled function, so the restriction applied whether or not the triggering property was present.

5 other lines we could not sort, mostly version bumps
  • Draft-07 is now read by its own rules rather than as 2020-12 with renamed keywords. A schema object carrying $ref is that reference and nothing else, so sibling keywords, $id included, are ignored, as the draft specifies. A fragment-only $id ("$id": "#name") is a plain-name anchor. A document supplied through schemas or addSchema() that declares no $schema of its own is read under the root's draft. JSON Pointers written against array-form items still resolve after the keyword is normalized to prefixItems. Schemas that declare no $schema are unaffected. Draft 7 on the official suite goes from 916 to 927 of 927.

    1.7.0
  • The code generator now declines, and the interpreted engine answers, whenever a document reachable through a cross-document $ref uses $dynamicRef, $dynamicAnchor, unevaluatedProperties, unevaluatedItems, or an embedded $id. Before, the generator emitted a vacuous check for such a reference and accepted everything behind it: { "$ref": "https://json-schema.org/draft/2020-12/schema" } accepted { "type": 1 }. These checks now live in one function, sharedCodegenGate, that every entry point runs first. Draft 2020-12 goes from 1294 to 1298 of 1299 and the v1 dialect from 1131 to 1133 of 1133; the one remaining 2020-12 miss needs $vocabulary.

    1.7.0
  • The interpreted engine extends the dynamic scope whenever evaluation enters a schema resource, not only when it lands on the resource's root. A $dynamicRef reached through first#/$defs/stuff now sees resource first in scope, which closes the last $dynamicRef case the interpreter missed. With code generation blocked the figures are the same as with it: 1298 of 1299, 927 of 927, 1133 of 1133.

    1.7.0
  • The interpreted engine is between 4 and 14 times faster depending on the schema. Each schema node is resolved once into a fixed-shape plan (type bitmask, compiled pattern, looked-up format, one flag per keyword group) and children are linked at plan time, so the walk reads no schema properties and does no map lookups. On a six-field object schema a warm validate() went from 3786 ns to 343 ns; a $ref-heavy schema from 5354 ns to 366 ns; a recursive $dynamicRef tree from 5302 ns to 526 ns. The compiled path is unchanged at about 44 ns on the same schema.

    1.7.0
  • The linear-time pattern matcher now runs a lazily built DFA over the Thompson NFA, with cached ASCII transitions and a fallback to the NFA walk past 256 states. On typical anchored patterns it is within 1.2 to 3.5 times of V8's backtracking engine (^[0-9]{5}$ 14 ns against 12 ns, an email pattern 70 ns against 21 ns) while keeping the linear bound: ^(a+)+$ against 100,000 characters takes 1 ms. This matcher backs pattern, patternProperties and propertyNames in every engine and in standalone output, so all of them gain.

    1.7.0

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