Repository navigation
v0.5.2
Descriptions for the document's tags, a check that holds a response to the document in a test, and the raw bytes of a body for a webhook's signature; a group is eight times cheaper for the type checker.
Added
@tetsujs/openapi:tagsinopenapi()anddocs()— what each tag is, by name, in the order a renderer lists the sections. A tag the routes use andtagsleaves out is listed after them and reported, and so is a described tag no operation uses: either is usually one tag spelled two ways.docs()describes its own tag when its routes are documented.@tetsujs/openapi/testing:assertDescribed(document, "POST /session", res)throws unless a response a test provoked is one the document describes for the operation — its status declared, its body one of the alternatives of that status, the headers asked about documented — and lists every problem at once.validatechecks the body in full with a JSON Schema validator of your choice.@tetsujs/core:rawBody: trueon a route keeps the bytes of ajsonortextbody asctx.rawBody, next to the body parsed and validated from them — for a webhook signed over its bytes. The field is typed only on a route that asks, so a hook requiring it withRequirescannot be mounted where it is missing; a form or a stream withrawBodyis refused.rawBodyis now the pipeline's own field: a hook that returned a field of that name no longer adds it to the context.
Changed
@tetsujs/core: agroup()costs the type checker about 130 instantiations where it cost about 1 090 — an application of 100 groups and 200 routes 194 k where it was 288 k, and 83 MB where it was 114. The children met the configuration's ownchildrenas an intersection of two array types, and every method of an array was built once per group. Its options besides the children areGroupOptions.@tetsujs/core: the package no longer ships the test helpers of this repository that@tetsujs/core/testingdoes not export — type assertions, a mock schema, a socket client. They were never importable.
Full Changelog: v0.5.1...v0.5.2