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


Java SwaggerSerializers类代码示例

本文整理汇总了Java中io.swagger.jaxrs.listing.SwaggerSerializers的典型用法代码示例。如果您正苦于以下问题:Java SwaggerSerializers类的具体用法?Java SwaggerSerializers怎么用?Java SwaggerSerializers使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SwaggerSerializers类属于io.swagger.jaxrs.listing包,在下文中一共展示了SwaggerSerializers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: customize

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的package包/类
@Override
public void customize(ResteasyConfig config) {
	if (configurationProperties.isEnabled()) {
		// Serializers
		if (!config.isRegistered(SwaggerSerializers.class)) {
			config.register(SwaggerSerializers.class);
		}
		// check configuration
		if (configurationProperties.isPrettyPrint()) {
			SwaggerSerializers.setPrettyPrint(true);
		}
		// API listings
		final List<ApiListingDefinition> definitions = SwaggerJaxrsUtils
				.getApiListings(configurationProperties);
		for (ApiListingDefinition definition : definitions) {
			definition.configureEndpoints(classLoader, apiPath).forEach(e -> {
				config.register(e.getResourceClass());
				LOGGER.info("[Resteasy] [" + e.getGroupId() + "] Swagger API listing configured - Path: "
						+ SwaggerJaxrsUtils.composePath(apiPath, e.getPath()));
			});
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:24,代码来源:SwaggerResteasyAutoConfiguration.java

示例2: customize

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的package包/类
@Override
public void customize(ResourceConfig config) {
	if (configurationProperties.isEnabled()) {
		// Serializers
		if (!config.isRegistered(SwaggerSerializers.class)) {
			config.register(SwaggerSerializers.class, Integer.MIN_VALUE - 100);
		}
		// check configuration
		if (configurationProperties.isPrettyPrint()) {
			SwaggerSerializers.setPrettyPrint(true);
		}
		// API listings
		final List<ApiListingDefinition> definitions = SwaggerJaxrsUtils.getApiListings(configurationProperties);
		for (ApiListingDefinition definition : definitions) {
			definition.configureEndpoints(classLoader, apiPath).forEach(e -> {
				config.register(e.getResourceClass());
				LOGGER.info("[Jersey] [" + e.getGroupId() + "] Swagger API listing configured - Path: "
						+ SwaggerJaxrsUtils.composePath(apiPath, e.getPath()));
			});
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-jaxrs,代码行数:23,代码来源:SwaggerJerseyAutoConfiguration.java

示例3: RESTConfig

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例4: BaseApplicaionConfig

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的package包/类
public BaseApplicaionConfig() {
    //设置默认时区
    System.setProperty("user.timezone", "Asia/Shanghai");

    register(ValidationContextResolver.class);
    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
    property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);

    this.packages(packages());
    register(ObjectMapperResolver.class);
    register(JacksonFeature.class);
    register(JacksonJsonProvider.class);
    register(new BaseExceptionMapper(createExcetionWrapper()));
    register(RequestContextFilter.class);

    register(DefaultWebFilter.class);

    if (FilterConfig.apiDocEnabled()) {
        register(SwaggerSerializers.class);
    }
}
 
开发者ID:warlock-china,项目名称:azeroth,代码行数:22,代码来源:BaseApplicaionConfig.java

示例5: configureSwagger

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例6: BaseApplicaionConfig

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的package包/类
public BaseApplicaionConfig() {
	//设置默认时区
	System.setProperty("user.timezone","Asia/Shanghai");
	
	register(ValidationContextResolver.class);
	property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
    property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);
			
	this.packages(packages());
	
	register(ObjectMapperResolver.class);
	register(JacksonFeature.class);
	register(JacksonJsonProvider.class);
	register(new BaseExceptionMapper(createExcetionWrapper()));
	register(RequestContextFilter.class);
	
	register(DefaultWebFilter.class);
	//
	if(FilterConfig.apiDocEnabled()){
		register(SwaggerSerializers.class);
	}
}
 
开发者ID:vakinge,项目名称:jeesuite-libs,代码行数:23,代码来源:BaseApplicaionConfig.java

示例7: Main

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例8: run

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例9: ApplicationConfig

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例10: OntoSoftServer

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例11: buildConfig

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例12: configureSwagger

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例13: bindSwagger

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的package包/类
private void bindSwagger() {
  BeanConfig beanConfig = new BeanConfig();
  beanConfig.setBasePath("/");
  beanConfig.setResourcePackage(API_PACKAGE);
  beanConfig.setScan(true);

  SwaggerModelTransformer transformer = SwaggerModelTransformer.builder()
          .addTransformation(new ResultContainerTransformation(ResultStash.class, "data"))
          .build();

  bind(SwaggerApiListingResource.class).in(Scopes.SINGLETON);
  bind(SwaggerSerializers.class).in(Scopes.SINGLETON);
  bind(SwaggerModelTransformer.class).toInstance(transformer);
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:15,代码来源:RestModule.java

示例14: startRestServer

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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

示例15: configureSwagger

import io.swagger.jaxrs.listing.SwaggerSerializers; //导入依赖的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


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