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


Java In类代码示例

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


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

示例1: swaggerConfig

import io.swagger.models.auth.In; //导入依赖的package包/类
@Bean
public BeanConfig swaggerConfig() {
	final BeanConfig beanConfig = new BeanConfig();
	beanConfig.setResourcePackage("com.github.sbugat.samplerest.resource");
	beanConfig.setVersion("1.0.0");
	beanConfig.setHost("localhost:8080");
	beanConfig.setBasePath(servletContext.getContextPath());
	beanConfig.setTitle("Swagger CXF, JAX-RS 2.0 sample");
	beanConfig.setDescription("This is a Swagger CXF, JAX-RS 2.0 sample API.");
	beanConfig.setContact("Sylvain Bugat");
	beanConfig.setLicense("Apache 2.0");
	beanConfig.setLicenseUrl("https://github.com/Sylvain-Bugat/swagger-cxf-rest-skeleton/blob/master/LICENSE");

	beanConfig.getSwagger().addSecurityDefinition("api_token", new ApiKeyAuthDefinition("api_token", In.HEADER));

	beanConfig.setScan(true);

	return beanConfig;
}
 
开发者ID:Sylvain-Bugat,项目名称:swagger-cxf-rest-skeleton,代码行数:20,代码来源:ApplicationConfiguration.java

示例2: isValidApiKeyDefinition

import io.swagger.models.auth.In; //导入依赖的package包/类
/**
 * Checks if the defined apiKey is valid or not. Only apiKey definition with name as 'key' and
 * 'in' as 'query' are allowed"
 */
private boolean isValidApiKeyDefinition(ApiKeyAuthDefinition apiKeydef) {
  if (apiKeydef.getName().equalsIgnoreCase("key") || apiKeydef.getIn() == In.QUERY) {
    return true;
  } else {
    diagCollector.addDiag(
        Diag.warning(
            SimpleLocation.UNKNOWN,
            "apiKey '%s' is ignored. Only apiKey with 'name' as 'key' and 'in' as 'query' are "
                + "supported",
            apiKeydef.getName()));
    return false;
  }
}
 
开发者ID:googleapis,项目名称:api-compiler,代码行数:18,代码来源:AuthBuilder.java

示例3: apiKeyAuth

import io.swagger.models.auth.In; //导入依赖的package包/类
public static ApiKeyAuthDefinition apiKeyAuth(String name, In in) {
    return new ApiKeyAuthDefinition(name, in);
}
 
开发者ID:tminglei,项目名称:binder-swagger-java,代码行数:4,代码来源:SwaggerContext.java


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