diff --git a/src/lib/routes/controller.ts b/src/lib/routes/controller.ts index 8c5598984ddf..7bade479eb46 100644 --- a/src/lib/routes/controller.ts +++ b/src/lib/routes/controller.ts @@ -65,7 +65,7 @@ const checkPrivateProjectPermissions = () => async (req, res, next) => { return res.status(404).end(); }; -const checkOpenAPIValidationError = () => async (err, req, res, next) => { +const checkOpenAPIValidationError = async (err, req, res, next) => { if (err?.status && err.validationErrors) { const apiError = fromOpenApiValidationErrors(req, err.validationErrors); @@ -126,7 +126,7 @@ export default class Controller { this.useRouteErrorHandler(options.handler.bind(this)), ); - this.app.use(options.path, checkOpenAPIValidationError()); + this.app.use(options.path, checkOpenAPIValidationError); } get(