A Typescript library to help you get an API server up and running with I/O schema validation and custom middlewares in minutes.
MIT License
Bot releases are hidden (Show)
Published by RobinTail 4 months ago
.remap()
by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1878
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v20.1.0...v20.2.0
Published by RobinTail 4 months ago
typescript-eslint
to v8 alpha 36. by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1868
typescript-eslint
to v8 alpha 38 by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1874
@eslint/js
by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1867
eslint-plugin-import-x
to 0.5.3 by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1877
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v20.0.1...v20.1.0
Published by RobinTail 4 months ago
_getJSONData()
method by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1865
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v20.0.0...v20.0.1
Published by RobinTail 4 months ago
This version focuses on improving typing, consistency of methods and approaches, and simplifying the testing approach. A number of creator functions have been replaced with classes. Creating ResultHandlers and Middlewares has become more flexible. To eliminate frequent confusion, a new approach to endpoint testing has been applied: request and response mocking is completely detached from testing frameworks and works out of the box without any tricks. For the first time, an automatic migration is offered as an ESLint plugin, which itself adapts your code to this version.
createLogger()
removed — use new BuiltinLogger()
instead if needed;createResultHandler
removed — use new ResultHandler()
instead:
getPositiveResponse
to positive
and getNegativeResponse
to negative
;createMiddleware()
removed — use either new Middleware()
or EndpointsFactory::addMiddleware()
instead:
middleware
renamed to handler
.testEndpoint()
was changed:
fnMethod
property removed from the argument;responseProps
property changed to responseOptions
, it's no longer meant to be used for custom props;requestMock
, responseMock
and loggerMock
no longer rely on testing framework for props.responseMock._getStatusCode()
, responseMock._getHeaders()
, responseMock._getData()
, loggerMock._getLogs()
;migration
in order to apply changes automatically (except assertions).// eslint.config.mjs — minimal config to apply migrations automatically using "eslint . --fix" (at least ESLint 8)
import parser from "@typescript-eslint/parser";
import migration from "express-zod-api/migration";
export default [{ languageOptions: { parser }, files: ["**/*.ts"] }, migration];
Published by RobinTail 4 months ago
no-extraneous-dependencies
rule operation by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1857
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v19.2.2...v19.2.3
Published by RobinTail 5 months ago
any
in tests by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1785
eslint
group to dependabot rules by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1812
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v19.2.1...v19.2.2
openapi3-ts
to 4.3.2 (fixed distribution) by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1784
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v19.2.0...v19.2.1
Published by RobinTail 5 months ago
.child()
method by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1778
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v19.1.2...v19.2.0
Published by RobinTail 5 months ago
beforeRouting
by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1761
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v18.6.2...v18.6.3
Published by RobinTail 5 months ago
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v19.1.1...v19.1.2
Published by RobinTail 5 months ago
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v19.1.0...v19.1.1
Published by RobinTail 5 months ago
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v19.0.0...v19.1.0
Published by RobinTail 5 months ago
This version is focused on making express-zod-api
a complete zod
plugin. In this regard withMeta
is removed in favor of the recommended approach on extending zod
functionality, which opens up opportunities for new features and simplifies the consumer experience. Another improvement has been made for parsers: they are now applied selectively depending on the type of expected request.
zod
: 3.23.0;express
: 4.19.2;express-fileupload
and @types/express-fileupload
: 1.5.0.withMeta()
EndpointsFactory::addOptions()
(see v18.6.0 for details);Endpoint
and DependsOnMethod
;ez.raw()
: additional properties should be supplied as its argument, not via .extend()
;server.upload.beforeUpload
now accepts request
instead of app
;server.beforeRouting
is now called before parsing too.info
for built-in logger (higher than debug
, but lower than warn
);Find the migration guide in the Changelog
Published by RobinTail 5 months ago
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v18.6.1...v18.6.2
Published by RobinTail 5 months ago
.addOptions
with caution.Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v18.6.0...v18.6.1
Published by RobinTail 5 months ago
.addOptions()
by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1753
Integration
by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1740
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v18.5.2...v18.6.0
Published by RobinTail 6 months ago
Method
via IRouter
by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1735
Array::slice()
over Array.from()
by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1737
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v18.5.1...v18.5.2
Published by RobinTail 6 months ago
Map
dictionaries by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1731
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v18.5.0...v18.5.1
Published by RobinTail 6 months ago
withMeta()
by @RobinTail in https://github.com/RobinTail/express-zod-api/pull/1719
See the details in Changelog
Published by RobinTail 6 months ago
Full Changelog: https://github.com/RobinTail/express-zod-api/compare/v18.3.0...v18.4.0