use of io.swagger.jaxrs.config.BeanConfig in project swagger-core by swagger-api.
the class SwaggerContextServiceTest method initMock.
@BeforeMethod
void initMock() {
servletContext1 = mock(ServletContext.class);
servletConfig1 = mock(ServletConfig.class);
servletContext2 = mock(ServletContext.class);
servletConfig2 = mock(ServletConfig.class);
jaxrsScanner = new DefaultJaxrsScanner();
BeanConfig bc = new BeanConfig();
bc.setDescription("Bean Config test 1");
beanConfigScanner1 = bc;
bc = new BeanConfig();
bc.setDescription("Bean Config test 2");
beanConfigScanner2 = bc;
}
use of io.swagger.jaxrs.config.BeanConfig in project metacat by Netflix.
the class ApiConfig method swaggerBeanConfig.
/**
* Swagger configuration.
*
* @param config The application configuration abstraction
* @return Swagger bean configuration
*/
@Bean
public BeanConfig swaggerBeanConfig(final Config config) {
final BeanConfig beanConfig = new BeanConfig();
// TODO: put this back and remove hard coding
// beanConfig.setVersion(config.getMetacatVersion());
beanConfig.setVersion("1.1.0");
beanConfig.setBasePath("/mds");
beanConfig.setResourcePackage("com.netflix.metacat");
beanConfig.setScan(true);
return beanConfig;
}
use of io.swagger.jaxrs.config.BeanConfig 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);
}
}
use of io.swagger.jaxrs.config.BeanConfig in project teiid by teiid.
the class BootstrapServlet method init.
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
BeanConfig beanConfig = new BeanConfig();
init(beanConfig);
}
use of io.swagger.jaxrs.config.BeanConfig in project Gaffer by gchq.
the class ApplicationConfigV1 method setupBeanConfig.
@Override
protected void setupBeanConfig() {
final BeanConfig beanConfig = new BeanConfig();
String basePath = System.getProperty(SystemProperty.BASE_PATH, SystemProperty.BASE_PATH_DEFAULT);
if (!basePath.startsWith("/")) {
basePath = "/" + basePath;
}
beanConfig.setBasePath(basePath + '/' + VERSION);
beanConfig.setConfigId(VERSION);
beanConfig.setScannerId(VERSION);
beanConfig.setResourcePackage("uk.gov.gchq.gaffer.rest.service.v1");
beanConfig.setScan(true);
}
Aggregations