use of com.github.phiz71.vertx.swagger.router.SwaggerRouter in project azure-iot-sdk-java by Azure.
the class MainApiVerticle method start.
@SuppressWarnings("deprecation")
@Override
public void start(Future<Void> startFuture) throws Exception {
Json.mapper.registerModule(new JavaTimeModule());
FileSystem vertxFileSystem = vertx.fileSystem();
vertxFileSystem.readFile("swagger.json", readFile -> {
if (readFile.succeeded()) {
Swagger swagger = new SwaggerParser().parse(readFile.result().toString(StandardCharsets.UTF_8));
Router swaggerRouter = SwaggerRouter.swaggerRouter(router, swagger, vertx.eventBus(), new OperationIdServiceIdResolver(), t -> new DeliveryOptions().setSendTimeout(90000));
deployVerticles(startFuture);
vertx.createHttpServer().requestHandler(swaggerRouter::accept).listen(8080);
startFuture.complete();
} else {
startFuture.fail(readFile.cause());
}
});
}
Aggregations