lukeautry / tsoa

Build OpenAPI-compliant REST APIs using TypeScript and Node
MIT License
3.32k stars 481 forks source link

Recently merged issue #1593 is a breaking change #1640

Closed miszczu-drako closed 3 weeks ago

miszczu-drako commented 3 weeks ago

https://github.com/lukeautry/tsoa/issues/1593 Merged 3 days ago changed behavior of express, by adding next() It broke the previously established functionality that no other middleware was called if request was handled correctly by registered routes. Now, no matter what, middlewares after RegisterRoute are always called.

Sorting

Expected Behavior

From my point of view it is a breaking change. My code looks like this. The logUnknownRoute has been called only when a request has path not handled by RegisterRoutes. Now it is called always.

  app.use(logIncomingRequest);
  RegisterRoutes(app);
  app.use(logUnknownRoute);
  app.use(errorHandler);

Possible Solution

I would ask you to make it configurable or revert the change made by #1593

Context (Environment)

Version of the library: 6.3.0 Version of NodeJS: v20.9.0

WoH commented 3 weeks ago

Reverted in v6.3.1

miszczu-drako commented 3 weeks ago

@WoH thanks for reacting so fast. I really appreciate it.