Description
The current template for MainApiVerticle incorrectly instantiates the protected main Router and does not re-use that router member with the instantiated SwaggerRouter. I propose that we modify the template as follows:
Initiantiate the router as part of the init flow to ensure that the vertx instance is not null:
Router router;
@Override
public void init(Vertx vertx, Context context) {
super.init(vertx, context);
router = Router.router(vertx);
}
Also, pass the router member as the first parameter of the SwaggerRouter creation:
Router swaggerRouter = SwaggerRouter.swaggerRouter(router, swagger, vertx.eventBus(), new OperationIdServiceIdResolver());
Swagger-codegen version
2.2.3 and above
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Description
The current template for MainApiVerticle incorrectly instantiates the protected main Router and does not re-use that router member with the instantiated SwaggerRouter. I propose that we modify the template as follows:
Initiantiate the router as part of the init flow to ensure that the
vertxinstance is not null:Also, pass the
routermember as the first parameter of the SwaggerRouter creation:Swagger-codegen version
2.2.3 and above
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement