• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Swagger2Feature类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getSingletons

import org.apache.cxf.jaxrs.swagger.Swagger2Feature; //导入依赖的package包/类
@Override
public Set<Object> getSingletons() {
    Swagger2Feature swagger = new Swagger2Feature();
    swagger.setBasePath("/");
    swagger.setHost("localhost:9000");
    swagger.setTitle("Order Service");
    swagger.setDescription("Rider Auto Parts Order Service");
    swagger.setVersion("2.0.0");
    swagger.setContact("[email protected]");
    swagger.setPrettyPrint(true);

    Set<Object> answer = new HashSet<>();
    answer.add(orderService);
    answer.add(new JacksonJsonProvider());
    answer.add(swagger);
    // to turn on verbose logging
    answer.add(new LoggingFeature());
    return answer;
}
 
开发者ID:camelinaction,项目名称:camelinaction2,代码行数:20,代码来源:RestOrderApplication.java


示例2: getSwagger2Feature

import org.apache.cxf.jaxrs.swagger.Swagger2Feature; //导入依赖的package包/类
/**
 * Create swagger2 feature.
 * 
 * @return Swagger2Feature Swagger2Feature bean
 */
@Bean
public Swagger2Feature getSwagger2Feature() {
    Swagger2Feature swagger = new Swagger2Feature();

    swagger.setLicense("appstatus-spring-boot licence");
    swagger.setLicenseUrl("#");
    swagger.setTitle("Appstatus Spring Boot");
    swagger.setVersion("1.0.0");

    return swagger;
}
 
开发者ID:appstatus,项目名称:appstatus-spring-boot-starter,代码行数:17,代码来源:ApiCxfConfig.java


示例3: rsServer

import org.apache.cxf.jaxrs.swagger.Swagger2Feature; //导入依赖的package包/类
@Bean
public Server rsServer() {
    JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean();
    endpoint.setBus(bus);
    endpoint.setAddress("/");
    endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(), new ExceptionRestHandler()));
    
    Map<Object, Object> mappings = new HashMap<Object, Object>();
    mappings.put("json", "application/json");
    endpoint.setExtensionMappings(mappings);
    
    Swagger2Feature swagger2Feature = new Swagger2Feature();
    swagger2Feature.setTitle(title);
    swagger2Feature.setDescription(description);
    swagger2Feature.setVersion(version);
    swagger2Feature.setContact(contact);
    swagger2Feature.setSchemes(schemes.split(","));
    swagger2Feature.setBasePath(basePath);
    swagger2Feature.setResourcePackage(resourcePackage);
    swagger2Feature.setPrettyPrint(prettyPrint);
    swagger2Feature.setScan(scan);
    
    endpoint.setFeatures(Arrays.asList(new LoggingFeature(), swagger2Feature));
    endpoint.setServiceBeans(Arrays.asList(tccCoordinatorService, compositeController));
    
    return endpoint.create();
}
 
开发者ID:jotorren,项目名称:microservices-transactions-tcc,代码行数:28,代码来源:WebServicesConfiguration.java


示例4: rsServer

import org.apache.cxf.jaxrs.swagger.Swagger2Feature; //导入依赖的package包/类
@Bean
public Server rsServer() {
    // setup CXF-RS
    JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean();
    endpoint.setBus(bus);
    endpoint.setServiceBeans(Arrays.<Object>asList(new HelloServiceImpl()));
    endpoint.setAddress("/");
    endpoint.setFeatures(Arrays.asList(new Swagger2Feature()));
    return endpoint.create();
}
 
开发者ID:fabric8-quickstarts,项目名称:spring-boot-cxf-jaxrs,代码行数:11,代码来源:SampleRestApplication.java


示例5: decorate

import org.apache.cxf.jaxrs.swagger.Swagger2Feature; //导入依赖的package包/类
@Override
public void decorate(JaxrsServiceDescriptor descriptor, Config config) {
    final Swagger2Feature feature = new Swagger2Feature();
    feature.setPrettyPrint(true);
    feature.setScan(false);
    descriptor.addFeature(feature);
}
 
开发者ID:Microbule,项目名称:microbule,代码行数:8,代码来源:SwaggerDecorator.java


示例6: testDecorate

import org.apache.cxf.jaxrs.swagger.Swagger2Feature; //导入依赖的package包/类
@Test
public void testDecorate() {
    final SwaggerDecorator decorator = new SwaggerDecorator();
    decorator.decorate(descriptor, null);
    verify(descriptor).addFeature(captor.capture());
    final Swagger2Feature feature = captor.getValue();
    assertTrue(feature.isPrettyPrint());
}
 
开发者ID:Microbule,项目名称:microbule,代码行数:9,代码来源:SwaggerDecoratorTest.java


示例7: setup

import org.apache.cxf.jaxrs.swagger.Swagger2Feature; //导入依赖的package包/类
@Before
public void setup() {
    catalog = new CamelCatalogRest();

    port = AvailablePortFinder.getNextAvailable(9000);

    // setup Apache CXF REST server
    JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
    sf.setResourceClasses(CamelCatalogRest.class);
    sf.setResourceProvider(CamelCatalogRest.class, new SingletonResourceProvider(catalog));

    Swagger2Feature swagger = new Swagger2Feature();
    swagger.setBasePath("/");
    swagger.setScanAllResources(false);
    swagger.setPrettyPrint(true);
    swagger.setSupportSwaggerUi(true);
    swagger.setTitle("Camel Catalog REST Api");
    swagger.setDescription("REST Api for the Camel Catalog");
    swagger.setVersion(catalog.getCatalogVersion());
    swagger.setContact("Apache Camel");
    sf.getFeatures().add(swagger);

    // to use jackson for json
    sf.setProvider(JacksonJsonProvider.class);
    sf.setAddress("http://localhost:" + port);

    // create and start the CXF server (non blocking)
    server = sf.create();
    server.start();
}
 
开发者ID:fabric8io,项目名称:django,代码行数:31,代码来源:CamelCatalogSwaggerTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DDefine类代码示例发布时间:2022-05-23
下一篇:
Java UserInfoErrorResponse类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap