use of gov.ca.cwds.rest.resources.TokenResource in project api-core by ca-cwds.
the class BaseApiApplication method configureSwagger.
private void configureSwagger(final T apiConfiguration, final Environment environment) {
BeanConfig config = new BeanConfig();
SwaggerConfiguration swaggerConfiguration = apiConfiguration.getSwaggerConfiguration();
config.setTitle(swaggerConfiguration.getTitle());
config.setDescription(swaggerConfiguration.getDescription());
config.setResourcePackage(swaggerConfiguration.getResourcePackage());
config.setScan(true);
new AssetsBundle(swaggerConfiguration.getAssetsPath(), swaggerConfiguration.getAssetsPath(), null, "swagger").run(environment);
LOGGER.info("Registering ApiListingResource");
environment.jersey().register(new ApiListingResource());
LOGGER.info("Registering SwaggerResource");
SwaggerResource swaggerResource = new SwaggerResource(swaggerConfiguration);
environment.jersey().register(swaggerResource);
if (swaggerConfiguration.isShowSwagger()) {
TokenResource tokenResource = new TokenResource(swaggerConfiguration);
environment.jersey().register(tokenResource);
}
}
Aggregations