Skip to content

Commit e33962f

Browse files
authored
Fix #2824 for v22 (#2830)
Fixes #2824 in v22 Copy of #2829
1 parent f511c6c commit e33962f

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/validations.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
name: dist
5050
- name: Add dependencies
5151
run: |
52-
yarn add express@${{matrix.express-version}} typescript@5.1 http-errors zod
52+
yarn add express@${{matrix.express-version}} typescript@5.1 http-errors zod@3
5353
yarn add -D eslint@9.0 typescript-eslint@8.0 vitest tsx
5454
yarn add express-zod-api@./dist.tgz
5555
- name: Run tests

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## Version 22
44

5+
### v22.14.1
6+
7+
- Compatibility fix for recently changed type of Express native middleware:
8+
- Fixes error `TS2345` when passing over an Express middleware to:
9+
- `EndpointsFactory::use()`;
10+
- `EndpointsFactory::addExpressMiddleware()`;
11+
- The issue caused by `@types/express-serve-static-core` v5.0.7;
12+
- The issue reported by [@zoton2](https://github.com/zoton2).
13+
514
### v22.14.0
615

716
- Supporting Node 24.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Therefore, many basic tasks can be accomplished faster and easier, in particular
8888

8989
These people contributed to the improvement of the framework by reporting bugs, making changes and suggesting ideas:
9090

91+
[<img src="https://github.com/zoton2.png" alt="@zoton2" width="50px" />](https://github.com/zoton2)
9192
[<img src="https://github.com/gmorgen1.png" alt="@gmorgen1" width="50px" />](https://github.com/gmorgen1)
9293
[<img src="https://github.com/crgeary.png" alt="@crgeary" width="50px" />](https://github.com/crgeary)
9394
[<img src="https://github.com/danmichaelo.png" alt="@danmichaelo" width="50px" />](https://github.com/danmichaelo)

express-zod-api/src/middleware.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,8 @@ export class ExpressMiddleware<
105105
OUT extends FlatObject,
106106
> extends Middleware<FlatObject, OUT, string> {
107107
constructor(
108-
nativeMw: (
109-
request: R,
110-
response: S,
111-
next: NextFunction,
112-
) => void | Promise<void>,
108+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- issue #2824, assignment compatibility fix
109+
nativeMw: (request: R, response: S, next: NextFunction) => any,
113110
{
114111
provider = () => ({}) as OUT,
115112
transformer = (err: Error) => err,

0 commit comments

Comments
 (0)