i don't understand, how to use swagger-ui with routing-controller.
i have tried:
@Controller('/api-docs')
@UseBefore(swagger.serve) //ERROR No overload matches this call
class SwaggerController {
@Get('/')
@UseBefore(swagger.setup(swaggerJson))
public swaggerUi(): void {}
}
but i got Error (No overload matches this call) for swagger.serve.
Now, i made it so:
// server.ts
const app = express();
useExpressServer(app, {/* controllers, middlewares, options */});
app.use('/api-docs', swagger.serve, swagger.setup(swaggerJson));
it works, but this is incorrect implementation (i think)
How use existing middlewares for that cases?