当前位置: 首页>>代码示例>>Java>>正文


Java ApiListingResource类代码示例

本文整理汇总了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);
    }
 
开发者ID:stacs-srg,项目名称:storr,代码行数:20,代码来源:RESTConfig.java

示例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);	
}
 
开发者ID:jotorren,项目名称:microservices-transactions-tcc,代码行数:18,代码来源:WebServicesConfiguration.java

示例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);
}
 
开发者ID:vgoldin,项目名称:cqrs-eventsourcing-kafka,代码行数:20,代码来源:InventoryItemApi.java

示例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());
}
 
开发者ID:danielflower,项目名称:app-runner,代码行数:38,代码来源:SwaggerDocs.java

示例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();
}
 
开发者ID:askplatypus,项目名称:platypus-kb-lucene,代码行数:20,代码来源:Main.java

示例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);
  }
}
 
开发者ID:rvs-fluid-it,项目名称:microservice-bundle,代码行数:19,代码来源:µService.java

示例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);
}
 
开发者ID:hopshadoop,项目名称:hopsworks,代码行数:25,代码来源:ApplicationConfig.java

示例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();
}
 
开发者ID:KnowledgeCaptureAndDiscovery,项目名称:ontosoft,代码行数:19,代码来源:OntoSoftServer.java

示例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;
}
 
开发者ID:dsukhoroslov,项目名称:bagri,代码行数:20,代码来源:BagriRestServer.java

示例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);
}
 
开发者ID:SciGraph,项目名称:SciGraph,代码行数:21,代码来源:MainApplication.java

示例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);
}
 
开发者ID:vahidR,项目名称:soren-subscriber,代码行数:31,代码来源:SorenSubscriberApplication.java

示例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);
}
 
开发者ID:wesleyfuchter,项目名称:user-task,代码行数:8,代码来源:JerseyConfig.java

示例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;
    }
}
 
开发者ID:SlideKB,项目名称:SlideBar,代码行数:32,代码来源:MainBack.java

示例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);
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:16,代码来源:AcmeAirApp.java

示例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);
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:16,代码来源:CustomerServiceApp.java


注:本文中的io.swagger.jaxrs.listing.ApiListingResource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。