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


Java AlternateTypeRule类代码示例

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


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

示例1: thingsboardApi

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
@Bean
public Docket thingsboardApi() {
    TypeResolver typeResolver = new TypeResolver();
    final ResolvedType jsonNodeType =
            typeResolver.resolve(
                    JsonNode.class);
    final ResolvedType stringType =
            typeResolver.resolve(
                    String.class);

      return new Docket(DocumentationType.SWAGGER_2)
              .groupName("iotp")
              .apiInfo(apiInfo())
              .alternateTypeRules(
                  new AlternateTypeRule(
                          jsonNodeType,
                          stringType))
              .select()
              .paths(apiPaths())
              .build()
              .securitySchemes(newArrayList(jwtTokenKey()))
              .securityContexts(newArrayList(securityContext()));
}
 
开发者ID:osswangxining,项目名称:iotplatform,代码行数:24,代码来源:SwaggerConfiguration.java

示例2: getDocket

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
/**
 * Gets the docket.
 *
 * @param groupName the group name
 * @param pathPattern the path pattern
 * @param apis the apis
 * @param apiinfo the apiinfo
 * @param tag the tag
 * @return the docket
 */
private Docket getDocket(
    String groupName,
    Predicate<String> pathPattern,
    Predicate<RequestHandler> apis,
    ApiInfo apiinfo,
    Tag tag) {
  return new Docket(DocumentationType.SWAGGER_2)
      .groupName(groupName)
      .select()
      .apis(apis)
      .paths(pathPattern)
      .build()
      .apiInfo(apiinfo)
      .pathMapping("/")
      .directModelSubstitute(LocalDate.class, String.class)
      .genericModelSubstitutes(ResponseEntity.class)
      .alternateTypeRules(
          new AlternateTypeRule(
              typeResolver.resolve(
                  DeferredResult.class,
                  typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
              typeResolver.resolve(WildcardType.class)))
      .useDefaultResponseMessages(false)
      .enableUrlTemplating(false)
      .tags(tag);
}
 
开发者ID:balajeetm,项目名称:json-mystique,代码行数:37,代码来源:SwaggerConfiguration.java

示例3: thingsboardApi

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
@Bean
public Docket thingsboardApi() {
    TypeResolver typeResolver = new TypeResolver();
    final ResolvedType jsonNodeType =
            typeResolver.resolve(
                    JsonNode.class);
    final ResolvedType stringType =
            typeResolver.resolve(
                    String.class);

      return new Docket(DocumentationType.SWAGGER_2)
              .groupName("thingsboard")
              .apiInfo(apiInfo())
              .alternateTypeRules(
                  new AlternateTypeRule(
                          jsonNodeType,
                          stringType))
              .select()
              .paths(apiPaths())
              .build()
              .securitySchemes(newArrayList(jwtTokenKey()))
              .securityContexts(newArrayList(securityContext()));
}
 
开发者ID:thingsboard,项目名称:thingsboard,代码行数:24,代码来源:SwaggerConfiguration.java

示例4: getAlternateTypeRule

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
protected AlternateTypeRule getAlternateTypeRule(Type sourceType, Type sourceGenericType,
        Type sourceSubGenericType, Type targetType, Type targetGenericType) {
    return AlternateTypeRules.newRule(
            typeResolver.resolve(sourceType,
                    typeResolver.resolve(sourceGenericType, sourceSubGenericType)),
            typeResolver.resolve(targetType, targetGenericType));
}
 
开发者ID:bozzo,项目名称:ipplan-api,代码行数:8,代码来源:SwaggerConfig.java

示例5: getMessageRule

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
private AlternateTypeRule getMessageRule(final TypeResolver resolver) {
	return new AlternateTypeRule(resolver.resolve(Message.class), this.getContreteMessageResolvedType(resolver));
}
 
开发者ID:rooting-company,项目名称:roxana,代码行数:4,代码来源:SwaggerAlternateTypeRuleConfig.java

示例6: getListMessageRule

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
private AlternateTypeRule getListMessageRule(final TypeResolver resolver) {
	return new AlternateTypeRule(this.getMessageListResolvedType(resolver), this.getContreteMessageResolvedType(resolver));
}
 
开发者ID:rooting-company,项目名称:roxana,代码行数:4,代码来源:SwaggerAlternateTypeRuleConfig.java

示例7: getArrayListMessageRule

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
private AlternateTypeRule getArrayListMessageRule(final TypeResolver resolver) {
	ResolvedType arrayListMessageResolvedType = resolver.resolveSubtype(this.getMessageListResolvedType(resolver), ArrayList.class);
	return new AlternateTypeRule(arrayListMessageResolvedType, this.getContreteMessageResolvedType(resolver));
}
 
开发者ID:rooting-company,项目名称:roxana,代码行数:5,代码来源:SwaggerAlternateTypeRuleConfig.java

示例8: getLinkedListMessageRule

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
private AlternateTypeRule getLinkedListMessageRule(final TypeResolver resolver) {
	ResolvedType linkedListMessageResolvedType = resolver.resolveSubtype(this.getMessageListResolvedType(resolver), LinkedList.class);
	return new AlternateTypeRule(linkedListMessageResolvedType, this.getContreteMessageResolvedType(resolver));
}
 
开发者ID:rooting-company,项目名称:roxana,代码行数:5,代码来源:SwaggerAlternateTypeRuleConfig.java

示例9: alternativeTypeRules

import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
/**
 * convert FlakeId and Zone to String in swagger document
 *
 * @see io.kaif.web.support.WebDataBinderAdvice
 * see json deserializer of FlakeId
 * see json deserializer of Zone
 */
private AlternateTypeRule[] alternativeTypeRules() {
  return new AlternateTypeRule[] { AlternateTypeRules.newRule(FlakeId.class, String.class),
      AlternateTypeRules.newRule(Zone.class, String.class) };
}
 
开发者ID:kaif-open,项目名称:kaif,代码行数:12,代码来源:SwaggerConfiguration.java


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