Releases: RobinTail/express-zod-api
v21.1.0
v21.0.0
Version 21 is for Kesaria
This version aims to improve the security and the overall development experience. In particular, the requirements for the Express version are increased, and you can now run the secure server exclusively. Alternative plural properties are replaced with universal singular ones supporting arrays. Specifying the method when creating an endpoint is now optional, which also makes it easier to assign endpoints on a same route for different methods. Memory consumption reduced for Routing traverse. Previously deprecated methods and properties have been removed, several public interfaces changed in order to enable features coming up later.
Breaking changes (and features)
- Minimum supported versions of
express
: 4.21.1 and 5.0.1 (fixed vulnerabilities); - For
createConfig()
argument:- The
server
property renamed tohttp
and made optional — (can now configure HTTPS only); - These properties moved to the top level:
jsonParser
,upload
,compression
,rawParser
andbeforeRouting
; - Both
logger
andgetChildLogger
arguments ofbeforeRouting
function are replaced with all-purposegetLogger
.
- The
- For
createServer()
resolved return:- Both
httpServer
andhttpsServer
are combined into singleservers
property (array, same order).
- Both
- For
EndpointsFactory::build()
argument:- Plural
methods
,tags
andscopes
properties replaced with singularmethod
,tag
,scope
accordingly; - The
method
property also made optional and can now be derived fromDependsOnMethod
or implyGET
by default; - When
method
is assigned with an array, it must be non-empty.
- Plural
- For
positive
andnegative
properties ofResultHandler
constructor argument:- Plural
statusCodes
andmimeTypes
props within the values are replaced with singularstatusCode
andmimeType
.
- Plural
- The
serializer
property ofDocumentation
andIntegration
constructor argument removed; - The
originalError
property ofInputValidationError
andOutputValidationError
removed (usecause
instead); - The
getStatusCodeFromError()
method removed (use theensureHttpError().statusCode
instead); - The
testEndpoint()
method can no longer test CORS headers — that function moved toRouting
traverse; - For
Endpoint
:getMethods()
may returnundefined
,getMimeTypes()
removed,getSchema()
variants reduced; - Public properties
pairs
,firstEndpoint
andsiblingMethods
ofDependsOnMethod
replaced withentries
.
Migration
- Check out sample in Changelog
- Consider the automated migration using the built-in ESLint rule:
// eslint.config.mjs — minimal ESLint 9 config to apply migrations automatically using "eslint --fix"
import parser from "@typescript-eslint/parser";
import migration from "express-zod-api/migration";
export default [
{ languageOptions: { parser }, plugins: { migration } },
{ files: ["**/*.ts"], rules: { "migration/v21": "error" } },
];
Full Changelog: v20.22.1...v21.0.0
v20.22.1
Fixes
- Avoid logo distortion by @RobinTail in #2198
- Self-diagnosis disabled on production by @RobinTail in #2199
Chores
- Vitest snapshot serializers instead of traversing schema in tests by @RobinTail in #2195
- Upgrading all dependencies. by @RobinTail in #2197
Full Changelog: v20.22.0...v20.22.1
v20.22.0
Feature
- Nested routes helper by @RobinTail in #2188
Chores
- Upgrading all dependencies by @RobinTail in #2184
- dependabot in #2186, #2189 and #2190
Full Changelog: v20.21.2...v20.22.0
v20.21.2
Fix
- Client: JSON parser in case of path params by @RobinTail in #2179
Chores
- Upgrading all dependencies. by @RobinTail in #2173
Full Changelog: v20.21.1...v20.21.2
v20.21.1
Fix
- Revert:
throw
instead ofassert
by @RobinTail in #2169
Chores
- Minor: ESLint config syntax by @RobinTail in #2165
- Upgrading
vitest
to 2.1.5 by @RobinTail in #2166 - @dependabot in #2170
Full Changelog: v20.21.0...v20.21.1
v20.21.0
Feature
- Making
input
schema optional by @RobinTail in #2129
Fix
- Performance tuning for
getInput()
by @RobinTail in #2160
Chores
- Dev: Adjusting package commands by @RobinTail in #2161
- dependabot in #2163 and 2164
Full Changelog: v20.20.1...v20.21.0
v20.20.1
Changes
- Style: Single statement blocks and empty returns by @RobinTail in #2156
- library → framework by @RobinTail in #2157
- Readme: fix small
handler
typo by @JonParton in #2158 - Upgrading all dependencies by @RobinTail in #2159
New Contributors
- @JonParton made their first contribution in #2158
Full Changelog: v20.20.0...v20.20.1
v20.20.0
Feature
- Ability to catch errors in
testMiddleware
by @RobinTail in #2154
Chores
- Upgrading all dependencies by @RobinTail in #2155
- dependabot in #2151 and #2152
Full Changelog: v20.19.0...v20.20.0
v20.19.0
Feature
- Making
logger
and itslevel
optional by @RobinTail in #2150
Full Changelog: v20.18.0...v20.19.0