You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Express路由中使用验证中间件时出现‘no overload matches this call’错误的求助

Express路由中使用验证中间件时出现‘no overload matches this call’错误的求助

大家好,我最近在编写Express的请求验证通用代码,参考了一篇博客的实现思路,只修改了部分变量名,核心逻辑和原文一致。但现在在路由中使用这个验证中间件时,一直报错no overload matches this call,实在找不到问题所在,来请教下各位帮忙排查下。

我的代码片段如下:

import { validate, ValidationError } from 'class-validator';
import { NextFunction } from 'express';
import { Request, Response } from 'express';

export function validationMiddleware<T extends object&

备注:内容来源于stack exchange,提问作者derstauner

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 16:15:28