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

Java SwaggerContextService类代码示例

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

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



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

示例1: init

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
  Info info = new Info()
    .title("Swagger Server")
    .description("RESTful API specification for the ElasTest Instrumentation Manager (EIM)")
    .termsOfService("")
    .contact(new Contact()
      .email("[email protected]"))
    .license(new License()
      .name("Apache License Version 2.0")
      .url("http://unlicense.org"));

  ServletContext context = config.getServletContext();
  Swagger swagger = new Swagger().info(info);

  new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
 
开发者ID:elastest,项目名称:elastest-instrumentation-manager,代码行数:18,代码来源:Bootstrap.java


示例2: init

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
  Info info = new Info()
    .title("Swagger Server")
    .description("RESTful API specification for the ElasTest Instrumentation Manager (EIM)")
    .termsOfService("TBD")
    .contact(new Contact()
      .email("[email protected]"))
    .license(new License()
      .name("Apache 2.0")
      .url("http://www.apache.org/licenses/LICENSE-2.0.html"));

  ServletContext context = config.getServletContext();
  Swagger swagger = new Swagger().info(info);
  String propertiesFile = "/WEB-INF/bootstrap.properties";
  Properties.load(config.getServletContext().getResourceAsStream(propertiesFile), propertiesFile);
  new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
 
开发者ID:elastest,项目名称:elastest-instrumentation-manager,代码行数:19,代码来源:Bootstrap.java


示例3: init

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
  Info info = new Info()
    .title("Swagger Server")
    .description("orchestrates backend jobs")
    .termsOfService("")
    .contact(new Contact()
      .email("[email protected]"))
    .license(new License()
      .name("LGPL 3.0")
      .url("http://www.gnu.org/licenses/lgpl-3.0.txt"));

  ServletContext context = config.getServletContext();
  Swagger swagger = new Swagger().info(info);

  new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
 
开发者ID:deelam,项目名称:agilion,代码行数:18,代码来源:Bootstrap.java


示例4: init

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
  Info info = new Info()
    .title("Swagger Server")
    .description("Jenkins API clients generated from Swagger / Open API specification")
    .termsOfService("")
    .contact(new Contact()
      .email("[email protected]"))
    .license(new License()
      .name("")
      .url("http://unlicense.org"));

  ServletContext context = config.getServletContext();
  Swagger swagger = new Swagger().info(info);

  new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
 
开发者ID:cliffano,项目名称:swaggy-jenkins,代码行数:18,代码来源:Bootstrap.java


示例5: registerSwaggerJsonResource

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


示例6: init

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
    Info info = new Info()
            .title("Docker Registry HTTP API v2")
            .description("")
            .termsOfService("")
            .contact(new Contact()
                    .email(""))
            .license(new License()
                    .name("")
                    .url(""));

    ServletContext context = config.getServletContext();
    Swagger swagger = new Swagger().info(info);

    new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
 
开发者ID:pubudu91,项目名称:docker-registry,代码行数:18,代码来源:Bootstrap.java


示例7: init

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
  Info info = new Info()
    .title("Swagger Server")
    .description("List of admin REST APIs for the pravega controller service.")
    .termsOfService("")
    .contact(new Contact()
      .email(""))
    .license(new License()
      .name("Apache 2.0")
      .url("http://www.apache.org/licenses/LICENSE-2.0"));

  ServletContext context = config.getServletContext();
  Swagger swagger = new Swagger().info(info);

  new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
 
开发者ID:pravega,项目名称:pravega,代码行数:18,代码来源:Bootstrap.java


示例8: registerSwagger

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@PostConstruct
private void registerSwagger() throws IOException {
    BeanConfig swaggerConfig = new BeanConfig();
    swaggerConfig.setTitle("Cloudbreak API");
    swaggerConfig.setDescription(FileReaderUtils.readFileFromClasspath("swagger/cloudbreak-introduction"));
    if (Strings.isNullOrEmpty(cbVersion)) {
        swaggerConfig.setVersion(VERSION_UNAVAILABLE);
    } else {
        swaggerConfig.setVersion(cbVersion);
    }
    swaggerConfig.setSchemes(new String[]{"http", "https"});
    swaggerConfig.setBasePath(CoreApi.API_ROOT_CONTEXT);
    swaggerConfig.setLicenseUrl("https://github.com/sequenceiq/cloudbreak/blob/master/LICENSE");
    swaggerConfig.setResourcePackage("com.sequenceiq.cloudbreak.api");
    swaggerConfig.setScan(true);
    swaggerConfig.setContact("https://hortonworks.com/contact-sales/");
    swaggerConfig.setPrettyPrint(true);
    SwaggerConfigLocator.getInstance().putConfig(SwaggerContextService.CONFIG_ID_DEFAULT, swaggerConfig);
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:20,代码来源:EndpointConfig.java


示例9: init

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
  Info info = new Info()
    .title("Swagger Server")
    .description("Create invoices, check payment and forward coins.")
    .termsOfService("")
    .contact(new Contact()
      .email(""))
    .license(new License()
      .name("")
      .url("http://unlicense.org"));

  ServletContext context = config.getServletContext();
  Swagger swagger = new Swagger().info(info);


  HashMap<String, String> params = new HashMap<>();
  //Build parameter Hashmap
  final Enumeration initParameterNames = config.getInitParameterNames();
  while(initParameterNames.hasMoreElements()){
    Object key = initParameterNames.nextElement();

    if(key instanceof String){
      params.put((String)key,config.getInitParameter((String)key));
    }
  }



  Bitcoin bitcoin = Bitcoin.getInstance();
  bitcoin.addParams(params);
  bitcoin.start();

  new SwaggerContextService().withServletConfig(config).updateSwagger(swagger);
}
 
开发者ID:IUNO-TDM,项目名称:PaymentService,代码行数:36,代码来源:Bootstrap.java


示例10: init

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
@Override
public void init(ServletConfig config) throws ServletException {
  try {
    BeanConfig beanConfig = new BeanConfig();
    beanConfig.setVersion("1.0");
    beanConfig.setTitle("Codenvy");
    beanConfig.setBasePath(new URL(agentEndpoint).getPath());
    beanConfig.scanAndRead();
    new SwaggerContextService().withSwaggerConfig(beanConfig).initConfig().initScanner();
  } catch (MalformedURLException e) {
    LOG.warn("Unable to initialize swagger config due to malformed agent URL.", e);
  }
}
 
开发者ID:codenvy,项目名称:codenvy,代码行数:14,代码来源:AgentSwaggerConfig.java


示例11: registerSwagger

import io.swagger.jaxrs.config.SwaggerContextService; //导入依赖的package包/类
private void registerSwagger() throws IOException {
    BeanConfig beanConfig = new BeanConfig();
    beanConfig.setTitle("Auto-scaling API");
    beanConfig.setDescription(FileReaderUtils.readFileFromClasspath("swagger/auto-scaling-introduction"));
    beanConfig.setVersion("1.9.0");
    beanConfig.setSchemes(new String[]{"http", "https"});
    beanConfig.setBasePath(AutoscaleApi.API_ROOT_CONTEXT);
    beanConfig.setLicenseUrl("https://github.com/sequenceiq/cloudbreak/blob/master/LICENSE");
    beanConfig.setResourcePackage("com.sequenceiq.periscope.api");
    beanConfig.setScan(true);
    beanConfig.setContact("https://hortonworks.com/contact-sales/");
    beanConfig.setPrettyPrint(true);
    SwaggerConfigLocator.getInstance().putConfig(SwaggerContextService.CONFIG_ID_DEFAULT, beanConfig);
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:15,代码来源:EndpointConfig.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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