本文整理汇总了Java中io.swagger.jaxrs.listing.ApiListingResource类的典型用法代码示例。如果您正苦于以下问题:Java ApiListingResource类的具体用法?Java ApiListingResource怎么用?Java ApiListingResource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ApiListingResource类属于io.swagger.jaxrs.listing包,在下文中一共展示了ApiListingResource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RESTConfig
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
public RESTConfig() {
BeanConfig beanConfig = new BeanConfig();
beanConfig.setVersion(STORR_API_VERSION);
beanConfig.setSchemes(new String[]{"http"});
beanConfig.setBasePath("/");
beanConfig.setResourcePackage(REST_PACKAGE);
beanConfig.setTitle("storr API");
beanConfig.setDescription("This REST API exposes the basic functions of storr. " +
"storr is a NoSQL store intended to provide easy storage of arbitrary tuples");
beanConfig.setScan(true);
beanConfig.setPrettyPrint(true);
packages(REST_PACKAGE);
register(LoggingFeature.class);
register(ApiListingResource.class);
register(SwaggerSerializers.class);
}
示例2: configureSwagger
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
private void configureSwagger() {
// Available at localhost:port/swagger.json
this.register(ApiListingResource.class);
this.register(SwaggerSerializers.class);
BeanConfig config = new BeanConfig();
// config.setConfigId(title);
config.setTitle(title);
config.setDescription(description);
config.setVersion(version);
config.setContact(contact);
config.setSchemes(schemes.split(","));
config.setBasePath(basePath);
config.setResourcePackage(resourcePackage);
config.setPrettyPrint(prettyPrint);
config.setScan(scan);
}
示例3: run
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
@Override
public void run(InventoryItemApiConfiguration configuration, Environment environment) throws Exception {
configureObjectMapper(environment);
CommandDispatcher commandDispatcher = configuration.getCommandDispatcherFactory().build(environment);
environment.jersey().register(new ApiListingResource());
environment.jersey().register(SseFeature.class);
InventoryItemResource resource = new InventoryItemResource(new InventoryItemsQuery(), commandDispatcher);
environment.jersey().register(resource);
environment.lifecycle().manage(new KafkaDenormalizer());
environment.lifecycle().manage(new HazelcastManaged());
StreamBroadcaster broadcaster = configuration.getStreamBroadcasterFactory().build(environment);
broadcaster.addObserver(resource);
configureSwagger(environment);
}
示例4: registerSwaggerJsonResource
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
static void registerSwaggerJsonResource(ResourceConfig rc) {
new SwaggerContextService()
.withSwaggerConfig(new SwaggerConfig() {
public Swagger configure(Swagger swagger) {
Info info = new Info();
info.setTitle("App Runner");
info.setDescription("The REST API for App Runner which is used for registering apps, deploying apps, viewing logs etc.");
info.setVersion("1.0");
swagger.setInfo(info);
swagger.setBasePath("/api/v1");
return swagger;
}
public String getFilterClass() {
return null;
}
})
.withScanner(new Scanner() {
private boolean prettyPrint;
public Set<Class<?>> classes() {
return rc.getInstances().stream().map(Object::getClass).collect(Collectors.toSet());
}
public boolean getPrettyPrint() {
return prettyPrint;
}
public void setPrettyPrint(boolean b) {
prettyPrint = b;
}
})
.initConfig()
.initScanner();
rc.packages(ApiListingResource.class.getPackage().getName());
}
示例5: Main
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
private Main() {
packages("us.askplatyp.kb.lucene.http");
register(JacksonFeature.class);
register(EntityFilteringFeature.class);
register(new AbstractBinder() {
@Override
protected void configure() {
bindFactory(WikidataLuceneIndexFactory.class).to(LuceneIndex.class);
}
});
register(CORSFilter.class);
register(ApiListingResource.class);
register(SwaggerSerializers.class);
EncodingFilter.enableFor(this, GZipEncoder.class);
EncodingFilter.enableFor(this, DeflateEncoder.class);
configureSwagger();
}
示例6: run
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
@Override
public void run(C configuration, Environment environment) throws Exception {
this.configuration = configuration;
this.environment = environment;
run(configuration, µsBundleInstance.µsEnvironment(this.environment));
if (configuration instanceof ZipkinAware) {
Brave brave = ((ZipkinAware)configuration).getZipkin().build(environment);
}
configureMapper(configuration, environment.getObjectMapper());
if (configuration instanceof ValidatorAware) {
environment.jersey().register(ValidationResource.class);
}
if (configuration instanceof SwaggerAware) {
environment.jersey().register(SwaggerSerializers.class);
environment.jersey().register(ApiListingResource.class);
environment.jersey().register(AcceptHeaderApiListingResource.class);
}
}
示例7: ApplicationConfig
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
public ApplicationConfig(){
register(AccessControlExceptionMapper.class);
register(AppExceptionMapper.class);
register(AuthExceptionMapper.class);
register(ThrowableExceptionMapper.class);
register(TransactionExceptionMapper.class);
//API V2
//Projects & Datasets
//register(ProjectAuthFilter.class);
register(ProjectsResource.class);
register(DatasetsResource.class);
register(MembersResource.class);
register(BlobsResource.class);
register(PathValidator.class);
//Hopsworks-Users
register(UsersResource.class);
//swagger
register(ApiListingResource.class);
register(SwaggerSerializers.class);
}
示例8: OntoSoftServer
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
public OntoSoftServer() {
// Headers
register(AcceptHeaderFilter.class);
register(CORSResponseFilter.class);
// User roles and authentication
register(RolesAllowedDynamicFeature.class);
register(UserAuthenticationFilter.class);
// Main Resources
register(UserResource.class);
register(SoftwareResource.class);
// OpenAPI documentation
register(ApiListingResource.class);
register(SwaggerSerializers.class);
initializeSwagger();
}
示例9: buildConfig
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
public ResourceConfig buildConfig() {
ResourceConfig config = new ResourceConfig(AccessService.class, CollectionService.class, DocumentService.class,
QueryService.class, SchemaService.class, TransactionService.class);
config.register(this);
config.register(AuthFilter.class);
config.register(JacksonFeature.class);
config.register(new AbstractBinder() {
@Override
protected void configure() {
bindFactory(BagriRestServer.this).to(RepositoryProvider.class);
}
});
config.register(WadlFeature.class);
config.registerInstances(reloader);
// adding Swagger support
config.register(ApiListingResource.class);
config.register(SwaggerSerializers.class);
return config;
}
示例10: configureSwagger
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
/***
* The context path must be set before configuring swagger
* @param environment
*/
void configureSwagger(Environment environment, String basePath) {
environment.jersey().register(new ApiListingResource());
environment.jersey().register(new SwaggerJsonBareService());
environment.jersey().register(new SwaggerSerializers());
ScannerFactory.setScanner(new DefaultJaxrsScanner());
environment.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
BeanConfig config = new BeanConfig();
// api specific configuration
config.setTitle("SciGraph");
config.setVersion("1.0.1");
config.setResourcePackage("io.scigraph.services.resources");
config.setScan(true);
// TODO: Fix this so the swagger client generator can work correctly
config.setBasePath("/" + basePath);
}
示例11: run
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
@Override
public void run(final SorenSubscriberConfiguration configuration, final Environment environment) {
// Registering DAOs and creating Guice
Injector injector = Guice.createInjector(new AbstractModule() {
@Override
protected void configure() {
DBIFactory factory = new DBIFactory();
DBI dbi = factory.build(environment, configuration.getDataSourceFactory(), DATABASE_TYPE.value);
SorenSubscriberDAO sorenSubscriberDAO = dbi.onDemand(SorenSubscriberDAO.class);
bind(SorenSubscriberDAO.class).toInstance(sorenSubscriberDAO);
}
});
// Swagger doc endpoint
environment.jersey().register(new ApiListingResource());
// Health Check registration
environment.jersey().register(injector.getInstance(SubscriberHealthCheck.class));
// Resources registration
environment.jersey().register(injector.getInstance(SubscriberResource.class));
environment.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL);
BeanConfig config = new BeanConfig();
config.setTitle("Swagger sample app");
config.setVersion("1.0.0");
config.setResourcePackage("org.vahid.resources");
config.setScan(true);
}
示例12: JerseyConfig
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
public JerseyConfig() {
property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
register(WebApplicationExceptionMapper.class);
register(ApiListingResource.class);
register(UserResourceImpl.class);
register(TaskResourceImpl.class);
}
示例13: startRestServer
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
public static HttpServer startRestServer() {
BeanConfig beanConfig = new BeanConfig();
beanConfig.setVersion("1.0.0");
beanConfig.setTitle("SlideBar REST Interface");
beanConfig.setResourcePackage(RootResource.class.getPackage().getName());
beanConfig.setSchemes(new String[] { "http" });
beanConfig.setHost("localhost:5055");
beanConfig.setScan(true);
final ResourceConfig rc = new ResourceConfig();
rc.packages(RootResource.class.getPackage().getName());
rc.register(LoggingFeature.class);
rc.register(JacksonFeature.class);
rc.register(ApiListingResource.class);
rc.register(SwaggerSerializers.class);
rc.property(ServerProperties.WADL_FEATURE_DISABLE, true);
Logger l = Logger.getLogger("org.glassfish.grizzly.http.server.HttpHandler");
l.setLevel(Level.FINE);
l.setUseParentHandlers(false);
ConsoleHandler ch = new ConsoleHandler();
ch.setLevel(Level.ALL);
l.addHandler(ch);
try {
return GrizzlyHttpServerFactory.createHttpServer(new URI("http://localhost:5055"), rc);
} catch (URISyntaxException e) {
e.printStackTrace();
return null;
}
}
示例14: configureSwagger
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
private void configureSwagger() {
register(ApiListingResource.class);
register(SwaggerSerializers.class);
// Just setup the configuration of the swagger API
BeanConfig config = new BeanConfig();
config.setConfigId("AcmeAire-BookingService");
config.setTitle("AcmeAire + BookingService ");
config.setVersion("v1");
config.setSchemes(new String[] {"http"});
config.setBasePath(apiPath);
config.setResourcePackage("com.acmeair");
config.setPrettyPrint(true);
config.setScan(true);
}
示例15: configureSwagger
import io.swagger.jaxrs.listing.ApiListingResource; //导入依赖的package包/类
private void configureSwagger() {
register(ApiListingResource.class);
register(SwaggerSerializers.class);
// Just setup the configuration of the swagger API
BeanConfig config = new BeanConfig();
config.setConfigId("AcmeAire-CustomerService");
config.setTitle("AcmeAire + CustomerService ");
config.setVersion("v1");
config.setSchemes(new String[]{"http"});
config.setBasePath(apiPath);
config.setResourcePackage("com.acmeair");
config.setPrettyPrint(true);
config.setScan(true);
}