本文整理汇总了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()));
}
示例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);
}
示例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()));
}
示例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));
}
示例5: getMessageRule
import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
private AlternateTypeRule getMessageRule(final TypeResolver resolver) {
return new AlternateTypeRule(resolver.resolve(Message.class), this.getContreteMessageResolvedType(resolver));
}
示例6: getListMessageRule
import springfox.documentation.schema.AlternateTypeRule; //导入依赖的package包/类
private AlternateTypeRule getListMessageRule(final TypeResolver resolver) {
return new AlternateTypeRule(this.getMessageListResolvedType(resolver), this.getContreteMessageResolvedType(resolver));
}
示例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));
}
示例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));
}
示例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) };
}