- upgraded dependencies:
npm:zod@^3.24.2
- multiple paths can now be registered on the same HTTP verb, and if the paths
are exactly the same, or if the "static" and the "parameter" portions of the
paths somehow overlap, then the handler is invoked once for each registered
path; for example if we register
@Get("/foo/:bar")
and@Get("/foo/bar")
(in that order) on the same handler function, then for every request to/foo/bar
, that handler is invoked twice, the first time having no "param" at all, and the 2nd time having the parambar
with the value"bar"
. This behavior follows TC39 decorator specs where all decorators to a function are applied "from inside out" aka: the last declared decorator gets applied first, and so on
ctx.state._oakRoutingCtrl_regPath
is available as a pointer to the registered path that matches the URL request currently being handled; this is helpful in rare situations where multiple overlapping paths are registered on the same handler function, causing it to be invoked multiple times, and so we may benefit from a mechanism to control when to write to the response body (as this operation can only be done once)
- Laxer usage of
ControllerMethodArgs
decorator: now allowingqueries
,params
,header
as literal arguments, so that things still work even if users accidentally / deliberately use the undocumented singular / plural forms - Support for Open API Spec v3.1
- Support for
operationId
andtags
in OAS path request declarations - Support for top-level
tags
in OAS document
- switched from
deps.ts
anddev_deps.ts
todeno.jsonc
- revamped documentation (JSDoc)
- code format & code format settings for VS Code users
- upgraded dependencies (
zod@^3.24.1
,@std/assert@^1.0.10
,@std/testing@^1.0.8
) - updated typing for
OakOpenApiSpec
(added prop:request
, untyped unproven prop:requestBody
) - upgraded dependencies:
jsr:@oak/oak@^17.1.4
,jsr:@std/assert@^1.0.11
,jsr:@std/io@^0.225.2
,jsr:@std/testing@^1.0.9
- the file
jsr.json
is removed in favour of the filedeno.jsonc
OakOpenApiSpec
anduseOak
are explicitly exported for consumption
- README content update
- underscore character is now supported in OAS path param name
- laxed parsing rule for requests with header 'content-type: application/json' now covers all 3 methods: GET, DELETE, and HEAD
- doc updated in README
- lax parsing rule for GET requests with header 'content-type: application/json'
- upgraded dependencies (
@std/path@^1.0.8
,@std/testing@^1.0.4
,@std/assert@^1.0.7
,@oak/oak@^17.1.3
,@asteasolutions/zod-to-openapi@^7.2.0
,@std/io@^0.225.0
) - code format
- if a handler function throws because of a
Zod
validation error (ie. fromZodSchema.parse()
), the response will automatically have status400
and the wholeZodError
as the response text
- support for
headers
inControllerMethodArg
as a shortcut to parse & retrieve request headers
-
upgraded dependencies (
@oak/[email protected]
,@std/[email protected]
@std/[email protected]
,@std/[email protected]
,@std/[email protected]
) -
minor TypeScript syntax updates to better support Deno 2
this
is retained when invoking controller methods./test_utils
excluded from dist package
@Controller
decorator doesn't require 2nd parametercontext
so it plays along better withexperimentalDecorators
mode (even this library doesn't support it officially)- improved README
z.infer
re-exported as typezInfer
- library publish command (the 2nd JSR provenance fix attempt)
- more non-type symbols re-exported from
z
- JSR provenance fix attempt (remedying previous Github Action failure)
- limited exported symbols from
SubsetOfZ
to an opinionated list of most widely used ones
z
"slow types" workaround attempt:SubsetOfZ
useOas
method is now documented
z
"slow types" workaround attempt
- decorators for 2 more methods:
@Head
and@Options
- support for Swagger documentation serving (powered by
@asteasolutions/zod-to-openapi
)
- upgraded dependencies:
@std/[email protected]
,@std/[email protected]
,@std/[email protected]
- typos in previous sections of this CHANGELOG
CONTRIBUTING.md
andGOVERNANCE.md
README.md
headline formatting should conform to best practices
- more symbols exported directly for better compatibilities with Cloudflare Workers projects (esp. in IDE environments such as Visual Studio Code)
- better support for JavaScript Registry documentation navigation indentation behaviors
- typo fix in README Markdown
- added test coverage chart to README
- attempted better format for JSR library main page
- organized example usages in README
- upgraded dependencies:
@oak/[email protected]
,@oak/[email protected]
,@std/assert@^0.226.0
- removed unnecessarily exported code from
dep.ts
- examples for other runtimes (
Node.js
,bun
)
- avoiding "slow types" in exported JSR lib
- compatibilities with Cloudflare Workers
- in
useOakServer
internal request handler logic,next()
is also called at the end
- unit tests
- README updates
- upgraded dependencies (
@std/testing@^0.225.1
) - Codecov integration
- renaming exported symbols:
SupportedControllerMethodArgs
=>ControllerMethodArg
ControllerActionArgs
=>ControllerMethodArgs
- consolidated (documented) enums for
@ControllerActionArgs
decorator arguments:param
,body
,query
- tests for
useOakServer
- respect response body if it's assigned to
ctx.response.body
inside the handler function just as when it's returned by the handler function itself
- upgraded dependencies (
@oak/[email protected]
,@std/path@^0.225.1
,@std/assert@^0.225.3
,@std/testing@^0.224.0
)
- upgraded dependency to
@oak/[email protected]
- decorator
@Patch
to use on controller method handling HTTP Patch requests
- calls without a request payload should no longer result in 400 'Unable to parse request body' error
- internal TypeScript update chores
- initial release