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
相关产品推荐
相关产品推荐

