+ BeanConfig config = new BeanConfig();
+ config.setTitle("ONAP ESR Service rest API");
+ config.setVersion("1.0.0");
+ config.setResourcePackage("org.onap.aai.esr.resource");
+ // set rest api basepath in swagger
+ SimpleServerFactory simpleServerFactory =
+ (SimpleServerFactory) configuration.getServerFactory();
+ String basePath = simpleServerFactory.getApplicationContextPath();
+ String rootPath = simpleServerFactory.getJerseyRootPath().get();
+ rootPath = rootPath.substring(0, rootPath.indexOf("/*"));
+ basePath =
+ basePath.equals("/") ? rootPath : (new StringBuilder()).append(basePath)
+ .append(rootPath).toString();
+ LOGGER.info("getApplicationContextPath: " + basePath);
+ config.setBasePath(basePath);
+ config.setScan(true);
+ }
+