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


Java Info.setDescription方法代码示例

本文整理汇总了Java中io.swagger.models.Info.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Info.setDescription方法的具体用法?Java Info.setDescription怎么用?Java Info.setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.swagger.models.Info的用法示例。


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

示例1: init

import io.swagger.models.Info; //导入方法依赖的package包/类
public void init() {
    if (!config.isConfigOk()) {
        return;
    }

    swagger = new Swagger();
    swagger.setHost(config.getHost());
    swagger.setBasePath("/");
    swagger.addScheme(HTTP);
    swagger.addScheme(HTTPS);


    Info swaggerInfo = new Info();
    swaggerInfo.setDescription(config.getDescription());
    swaggerInfo.setVersion(config.getVersion());
    swaggerInfo.setTitle(config.getTitle());
    swaggerInfo.setTermsOfService(config.getTermsOfService());

    Contact contact = new Contact();
    contact.setName(config.getContactName());
    contact.setEmail(config.getContactEmail());
    contact.setUrl(config.getContactUrl());
    swaggerInfo.setContact(contact);

    License license = new License();
    license.setName(config.getLicenseName());
    license.setUrl(config.getLicenseUrl());
    swaggerInfo.setLicense(license);


    swagger.setInfo(swaggerInfo);

    List<Class> classes = ClassScanner.scanClassByAnnotation(RequestMapping.class, false);

    Reader.read(swagger, classes);

}
 
开发者ID:yangfuhai,项目名称:jboot,代码行数:38,代码来源:JbootSwaggerManager.java

示例2: execute

import io.swagger.models.Info; //导入方法依赖的package包/类
@Override
public void execute() {
	BeanConfig swaggerConfig = new BeanConfig();
	swaggerConfig.setResourcePackage(PropertiesUtil.get("base", "swagger.scan"));
	swaggerConfig.setVersion("1.0.0");
	swaggerConfig.setSchemes(new String[] { "http", "https" });
	swaggerConfig.setHost("localhost");
	swaggerConfig.setBasePath("/service");
	swaggerConfig.setScan(true);
	Info info = new Info();
	info.setTitle(PropertiesUtil.get("base", "serviceCode") + " API");
	info.setDescription(PropertiesUtil.get("base", "serviceDescription"));
	swaggerConfig.setInfo(info);
}
 
开发者ID:nince-wyj,项目名称:jahhan,代码行数:15,代码来源:SwaggerIniter.java

示例3: setupSwagger

import io.swagger.models.Info; //导入方法依赖的package包/类
@Override
public void setupSwagger(BeanConfig beanConfig) {
	Info info = new Info();
	info.setTitle("DPB1 Epitope Service");
	info.setDescription("This service reports on alleles and their associated immunogenicity groups and provides matching functions.");
    beanConfig.setResourcePackage("org.nmdp.service.epitope.resource");
    beanConfig.setPrettyPrint(true);
	beanConfig.setInfo(info);
}
 
开发者ID:nmdp-bioinformatics,项目名称:service-epitope,代码行数:10,代码来源:EpitopeServiceApplication.java

示例4: getResourceSwaggerJson

import io.swagger.models.Info; //导入方法依赖的package包/类
public String getResourceSwaggerJson(){
	
	SwaggerSerializers.setPrettyPrint(true);				
	ReaderConfig readerConfig = new PlayReaderConfig();
	
	Swagger swagger = new Swagger();
	PlaySwaggerConfig config = PlayConfigFactory.getConfig();
	
	swagger.setHost(config.getHost());
	swagger.setBasePath(config.getBasePath());		
	
	Info info = new Info();
	info.setVersion(config.getVersion());
	info.setTitle(config.getTitle());
	info.setContact(new Contact().name(config.getContact()));
	info.setLicense(new License().name(config.getLicense()).url(config.getLicenseUrl()));
	info.setDescription(config.getDescription());
	info.setTermsOfService(config.getTermsOfServiceUrl());
			
	swagger.setInfo(info);
	
	PlayReader reader = new PlayReader(swagger, readerConfig);
	swagger = reader.read(controllerClasses);
		   
	ObjectMapper commonMapper = Json.mapper();
	
	try {
		return commonMapper.writeValueAsString(swagger);
	} catch (JsonProcessingException e) {
		Logger.error(e.getMessage());			
		return "";
	}
}
 
开发者ID:abhishekShukla,项目名称:swagger-play,代码行数:34,代码来源:ApiHelpInventory.java

示例5: start

import io.swagger.models.Info; //导入方法依赖的package包/类
@Override
public ServiceHost start() throws Throwable {
    SwaggerDescriptorService swagger = new SwaggerDescriptorService();
    Info info = new Info();
    info.setDescription(INFO_DESCRIPTION);
    info.setTermsOfService(INFO_TERMS_OF_SERVICE);
    info.setTitle("title");
    info.setVersion("version");

    swagger.setExcludeUtilities(true);
    swagger.setExcludedPrefixes(
            "/core/synch-tasks",
            "/core/callbacks",
            "/core/netty-maint-proxies",
            "/core/query-page-forwarding",
            "/core/service-context-index");
    swagger.setInfo(info);
    super.start();

    super.startDefaultCoreServicesSynchronously();

    // Start the root namespace factory: this will respond to the root URI (/) and list all
    // the factory services.
    super.startService(new RootNamespaceService());

    this.startService(swagger);

    this.startService(
            Operation.createPost(UriUtils.buildFactoryUri(this, ExampleService.class)),
            ExampleService.createFactory());

    this.startService(Operation.createPost(UriUtils.buildFactoryUri(this, CarService.class)),
            CarService.createFactory());

    this.startService(Operation.createPost(UriUtils.buildUri(this, UiService.class)),
            new UiService());

    this.startService(
            Operation.createPost(UriUtils.buildFactoryUri(this, ExampleService.class)),
            new ExampleService());

    this.startService(Operation.createPost(UriUtils.buildUri(this, TokenService.class)),
            new TokenService());

    this.startService(Operation.createPost(UriUtils.buildUri(this, NsOwnerService.class)),
            new NsOwnerService());

    return this;
}
 
开发者ID:vmware,项目名称:xenon-utils,代码行数:50,代码来源:ExampleServiceHostWithSwagger.java

示例6: setup

import io.swagger.models.Info; //导入方法依赖的package包/类
@BeforeClass
public static void setup() throws Throwable {
    host = VerificationHost.create(0);
    System.out.println("Host details: " + host);

    SwaggerDescriptorService swagger = new SwaggerDescriptorService();
    Info info = new Info();
    info.setDescription(INFO_DESCRIPTION);
    info.setTermsOfService(INFO_TERMS_OF_SERVICE);
    info.setTitle("title");
    info.setVersion("version");

    swagger.setSwaggerPostprocessor( s -> s.getInfo().setVersion("postprocessed"));

    swagger.setInfo(info);
    swagger.setExcludedPrefixes("/core/authz/");

    swagger.setStripPackagePrefixes("com:vmware:xenon:common:");

    host.start();

    host.startService(swagger);

    host.startService(
            Operation.createPost(UriUtils.buildFactoryUri(host, ExampleService.class)),
            ExampleService.createFactory());

    host.startService(Operation.createPost(UriUtils.buildFactoryUri(host, CarService.class)),
            CarService.createFactory());

    host.startService(Operation.createPost(UriUtils.buildUri(host, UiService.class)),
            new UiService());

    host.startService(
            Operation.createPost(UriUtils.buildFactoryUri(host, ExampleService.class)),
            new ExampleService());

    host.startService(Operation.createPost(UriUtils.buildUri(host, TokenService.class)),
            new TokenService());

    host.startService(Operation.createPost(UriUtils.buildUri(host, NsOwnerService.class)),
            new NsOwnerService());

    host.waitForServiceAvailable(SwaggerDescriptorService.SELF_LINK);
}
 
开发者ID:vmware,项目名称:xenon-utils,代码行数:46,代码来源:TestSwaggerDescriptorService.java

示例7: parseCommon

import io.swagger.models.Info; //导入方法依赖的package包/类
private static Swagger parseCommon(String requestUrl, Project project) {
	Swagger swagger = new Swagger();
	
	Contact contact = new Contact();
	/*contact.setName("Convertigo Support");
	contact.setEmail("[email protected]");
	contact.setUrl("http://www.convertigo.com/#developers");*/
	
	Info info = new Info();
	info.setContact(contact);
	info.setTitle("Convertigo REST API");
	info.setDescription("Find here all deployed projects");
	if (project != null) {
		info.setDescription(project.getComment());
		info.setVersion(project.getVersion());			
	}

	List<Scheme> schemes = new ArrayList<Scheme>();
	String host;
	String basePath;
	
	Matcher matcher = parseRequestUrl.matcher(requestUrl);
	if (matcher.find()) {
		schemes.add(matcher.group(1) == null ? Scheme.HTTP : Scheme.HTTPS);
		host = matcher.group(2);
		basePath = matcher.group(3);
	} else {
		String webAppPath = EnginePropertiesManager.getProperty(PropertyName.APPLICATION_SERVER_CONVERTIGO_URL);
		int index = webAppPath.indexOf("://") + 3;
		host = webAppPath.substring(index, webAppPath.indexOf('/', index));
		basePath = webAppPath.substring(index + host.length()) + "/api";
		schemes.add(Scheme.HTTP);
		schemes.add(Scheme.HTTPS);
	}
	swagger.setInfo(info);
	swagger.setSchemes(schemes);
	swagger.setHost(host);
	swagger.setBasePath(basePath);
	
	swagger.setConsumes(Arrays.asList("multipart/form-data", MimeType.WwwForm.value(), MimeType.Json.value(), MimeType.Xml.value()));
	
	swagger.setProduces(Arrays.asList(MimeType.Json.value(), MimeType.Xml.value()));
	return swagger;
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:45,代码来源:SwaggerUtils.java

示例8: initSwagger

import io.swagger.models.Info; //导入方法依赖的package包/类
public void initSwagger(BeanConfig swaggerConfig, Map<String, Object> config) {
    // configure swagger options
    String s = (String) config.get("swagger.version");
    if (s != null) {
        swaggerConfig.setVersion(s);
    }
    s = (String) config.get("base.path");
    if (s != null) {
        swaggerConfig.setBasePath(s);
    }
    s = (String) config.get("host");
    if (s != null) {
        swaggerConfig.setHost(s);
    }
    s = (String) config.get("cors");
    if (s != null) {
        cors = "true".equalsIgnoreCase(s);
    }
    s = (String) config.get("schemes");
    if (s == null) {
        // deprecated due typo
        s = (String) config.get("schemas");
    }
    if (s != null) {
        String[] schemes = s.split(",");
        swaggerConfig.setSchemes(schemes);
    } else {
        // assume http by default
        swaggerConfig.setSchemes(new String[]{"http"});
    }

    String version = (String) config.get("api.version");
    String title = (String) config.get("api.title");
    String description = (String) config.get("api.description");
    String termsOfService = (String) config.get("api.termsOfService");
    String licenseName = (String) config.get("api.license.name");
    String licenseUrl = (String) config.get("api.license.url");
    String contactName = (String) config.get("api.contact.name");
    String contactUrl = (String) config.get("api.contact.url");
    String contactEmail = (String) config.get("api.contact.email");

    Info info = new Info();
    info.setVersion(version);
    info.setTitle(title);
    info.setDescription(description);
    info.setTermsOfService(termsOfService);

    if (licenseName != null || licenseUrl != null) {
        License license = new License();
        license.setName(licenseName);
        license.setUrl(licenseUrl);
        info.setLicense(license);
    }

    if (contactName != null || contactUrl != null || contactEmail != null) {
        Contact contact = new Contact();
        contact.setName(contactName);
        contact.setUrl(contactUrl);
        contact.setEmail(contactEmail);
        info.setContact(contact);
    }

    swaggerConfig.setInfo(info);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:65,代码来源:RestSwaggerSupport.java

示例9: RestAPIResourceConfig

import io.swagger.models.Info; //导入方法依赖的package包/类
public RestAPIResourceConfig() {
  register(new AbstractBinder() {
    @Override
    protected void configure() {
      bindFactory(PipelineStoreInjector.class).to(PipelineStoreTask.class);
      bindFactory(AclStoreInjector.class).to(AclStoreTask.class);
      bindFactory(StageLibraryInjector.class).to(StageLibraryTask.class);
      bindFactory(PrincipalInjector.class).to(Principal.class);
      bindFactory(URIInjector.class).to(URI.class);
      bindFactory(ConfigurationInjector.class).to(Configuration.class);
      bindFactory(RuntimeInfoInjector.class).to(RuntimeInfo.class);
      bindFactory(BuildInfoInjector.class).to(BuildInfo.class);
      bindFactory(StandAndClusterManagerInjector.class).to(Manager.class);
      bindFactory(SupportBundleInjector.class).to(SupportBundleManager.class);
      bindFactory(UserGroupManagerInjector.class).to(UserGroupManager.class);
      bindFactory(ActivationInjector.class).to(Activation.class);
    }
  });

  register(RolesAllowedDynamicFeature.class);
  register(CsrfProtectionFilter.class);
  register(MultiPartFeature.class);

  //Hooking up Swagger-Core
  register(ApiListingResource.class);
  register(SwaggerSerializers.class);

  //Configure and Initialize Swagger
  BeanConfig beanConfig = new BeanConfig();
  beanConfig.setVersion("1.0.0");
  beanConfig.setBasePath("/rest");
  beanConfig.setResourcePackage(RestAPI.class.getPackage().getName());
  beanConfig.setScan(true);
  beanConfig.setTitle("Data Collector RESTful API");

  Info info = new Info();
  info.setTitle("Data Collector RESTful API");
  info.setDescription("An Enterprise-Grade Approach to Managing Big Data in Motion");
  info.setVersion("1.0.0");
  beanConfig.setInfo(info);
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:42,代码来源:RestAPIResourceConfig.java


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