import {GlobalProviders, ProviderType, TypedProvidersRegistry} from "@tsed/di";
import {ControllerProvider} from "../class/ControllerProvider";
import {ExpressRouter} from "../services/ExpressRouter";

// tslint:disable-next-line: variable-name
export const ControllerRegistry: TypedProvidersRegistry = GlobalProviders.createRegistry(ProviderType.CONTROLLER, ControllerProvider, {
  injectable: false,

  onInvoke(provider: ControllerProvider, locals: any) {
    locals.set(ExpressRouter, provider.router);
  }
});

import {GlobalProviders, ProviderType, TypedProvidersRegistry} from "@tsed/di";
import {ControllerProvider} from "../class/ControllerProvider";
import {ExpressRouter} from "../services/ExpressRouter";

// tslint:disable-next-line: variable-name
export const ControllerRegistry: TypedProvidersRegistry = GlobalProviders.createRegistry(ProviderType.CONTROLLER, ControllerProvider, {
  injectable: false,

  onInvoke(provider: ControllerProvider, locals: any) {
    if (!locals.has(ExpressRouter)) {
      locals.set(ExpressRouter, provider.router);
    }
  }
});

--- 
+++ 
@@ -7,8 +7,6 @@
   injectable: false,
 
   onInvoke(provider: ControllerProvider, locals: any) {
-    if (!locals.has(ExpressRouter)) {
-      locals.set(ExpressRouter, provider.router);
-    }
+    locals.set(ExpressRouter, provider.router);
   }
 });
fix: Remove precondition when building a controller
