本文整理汇总了Java中springfox.documentation.schema.WildcardType类的典型用法代码示例。如果您正苦于以下问题:Java WildcardType类的具体用法?Java WildcardType怎么用?Java WildcardType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WildcardType类属于springfox.documentation.schema包,在下文中一共展示了WildcardType类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: practiceApi
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket practiceApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.sdcuike.practice"))
.paths(PathSelectors.any())
.build()
.pathMapping("/")
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET,
newArrayList(new ResponseMessageBuilder()
.code(500)
.message("500 message")
.responseModel(new ModelRef("Error"))
.build()))
.enableUrlTemplating(true)
.tags(new Tag("Pet Service", "All apis relating to pets"));
}
示例2: api
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.pathMapping("/")
.directModelSubstitute(LocalDate.class, String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(AlternateTypeRules.newRule(typeResolver.resolve(
DeferredResult.class,
typeResolver.resolve(ResponseEntity.class,
WildcardType.class)),
typeResolver.resolve(
WildcardType.class)))
.useDefaultResponseMessages(false);
}
示例3: swaggerSpringMvcPlugin
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket swaggerSpringMvcPlugin() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("business-api")
.select()
.apis(RequestHandlerSelectors.basePackage(App.class.getPackage().getName()))
.paths(PathSelectors.any())
.build()
.pathMapping("/")
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(newRule(typeResolver.resolve(DeferredResult.class, typeResolver.resolve(ResponseEntity.class, WildcardType.class)), typeResolver.resolve(WildcardType.class)))
// .enableUrlTemplating(true)
.useDefaultResponseMessages(true)
.forCodeGeneration(false)
.host(host())
.apiInfo(apiInfo());
}
示例4: petApi
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket petApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
// .apis(RequestHandlerSelectors.any())
.apis(RequestHandlerSelectors.basePackage("com.tvajjala.resource"))
.paths(PathSelectors.any())
// .paths(PathSelectors.ant("/api/*"))
.build()
.apiInfo(apiInfo())
.pathMapping("/api")
// .directModelSubstitute(LocalDate.class, String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class, typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET,
newArrayList(new ResponseMessageBuilder().code(500).message("500 message").responseModel(new ModelRef("Error")).build()))
.securitySchemes(newArrayList(apiKey())).securityContexts(newArrayList(securityContext()));
}
示例5: petApi
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket petApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
// .apis(RequestHandlerSelectors.any())
.apis(RequestHandlerSelectors.basePackage("com.tvajjala.web.resource"))
.paths(PathSelectors.any())
// .paths(PathSelectors.ant("/api/*"))
.build()
.apiInfo(apiInfo())
.pathMapping("/api")
// .directModelSubstitute(LocalDate.class, String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class, typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET,
newArrayList(new ResponseMessageBuilder().code(500).message("500 message").responseModel(new ModelRef("Error")).build()))
.securitySchemes(newArrayList(apiKey())).securityContexts(newArrayList(securityContext()));
}
示例6: restApi
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket restApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.directModelSubstitute(LocalDate.class, String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(
typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class))
)
.select()
.paths(regex("^(/translation|/v2/api-docs).*$"))
.build();
}
示例7: medicamentApi
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket medicamentApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.regex("/api/.*"))
.build()
.pathMapping("/")
.apiInfo(apiInfo())
.directModelSubstitute(LocalDate.class, String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET,
newArrayList(new ResponseMessageBuilder()
.code(500)
.message("500 message")
.responseModel(new ModelRef("Error"))
.build()))
.enableUrlTemplating(false);
}
示例8: petApi
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket petApi() {
return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.any()).paths(PathSelectors.any()).build().pathMapping("/")
.apiInfo(new ApiInfo(
"Peregrine Event Service",
"Peregrine Event Service is a canonical implementation of the Event store pattern",
"0.0.1",
"",
"Alliance Foundry, a Fidelity Investments Open Source Project",
"Apache 2.0",
"http://www.apache.org/licenses/LICENSE-2.0.html"))
.consumes(new HashSet<String>(Arrays.asList("application/json")))
.produces(new HashSet<String>(Arrays.asList("application/json")))
.protocols(new HashSet<String>(Arrays.asList("http")))
.directModelSubstitute(LocalDate.class, String.class)
.directModelSubstitute(DateTime.class, String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(newRule(typeResolver.resolve(DeferredResult.class, typeResolver.resolve(ResponseEntity.class, WildcardType.class)), typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET, newArrayList(new ResponseMessageBuilder().code(500).message("500 message").responseModel(new ModelRef("Error")).build()));
//.securitySchemes(newArrayList(apiKey())).securityContexts(newArrayList(securityContext()));
}
示例9: api
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket api(){
return new Docket(DocumentationType.SWAGGER_2)
.useDefaultResponseMessages(false)
.forCodeGeneration(false)
.alternateTypeRules(
getAlternateTypeRule(Collection.class, WildcardType.class, List.class,
WildcardType.class),
getAlternateTypeRule(Stream.class, WildcardType.class, List.class,
WildcardType.class),
getAlternateTypeRule(DeferredResult.class, List.class, WildcardType.class,
List.class, WildcardType.class))
.ignoredParameterTypes(PagedResourcesAssembler.class, Pageable.class)
.directModelSubstitute(MessageSourceResolvable.class, String.class)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.regex("/api/.*"))
.build()
.apiInfo(apiInfo());
}
示例10: createIndoorRestApiDocket
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
/**
* Creates for the dynamic documentation necessary REST API Docket.
* @param typeResolver The type resolver. Must not be <code>null</code>.
* @return The requested REST API Docket.
*/
public static Docket createIndoorRestApiDocket(TypeResolver typeResolver) {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(Predicates.not(PathSelectors.regex(EXCLUDE_ERROR_PATH_REGEX)))
.build()
.pathMapping(ROOT_PATH)
.directModelSubstitute(LocalDate.class,
String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.enableUrlTemplating(false)
.tags(new Tag(TAG_NAME, TAG_DESCRIPTION)).apiInfo(apiInfo());
}
示例11: getDocket
import springfox.documentation.schema.WildcardType; //导入依赖的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);
}
示例12: api
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.pathMapping("/")
.directModelSubstitute(LocalDate.class,
String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET,
newArrayList(new ResponseMessageBuilder()
.code(500)
.message("500 message")
.responseModel(new ModelRef("Error"))
.build()))
.securitySchemes(newArrayList(apiKey()))
.securityContexts(newArrayList(securityContext()))
.enableUrlTemplating(true)
;
}
示例13: petApi
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket petApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.pathMapping("/")
.directModelSubstitute(LocalDate.class,
String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET,
newArrayList(new ResponseMessageBuilder()
.code(500)
.message("500 message")
.responseModel(new ModelRef("Error"))
.build()))
.securitySchemes(newArrayList(apiKey()))
.securityContexts(newArrayList(securityContext()))
.enableUrlTemplating(false)
;
}
示例14: petApi
import springfox.documentation.schema.WildcardType; //导入依赖的package包/类
@Bean
public Docket petApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.pathMapping("/")
.directModelSubstitute(LocalDate.class,
String.class)
.genericModelSubstitutes(ResponseEntity.class)
.alternateTypeRules(
newRule(typeResolver.resolve(DeferredResult.class,
typeResolver.resolve(ResponseEntity.class, WildcardType.class)),
typeResolver.resolve(WildcardType.class)))
.useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET,
asList(new ResponseMessageBuilder()
.code(500)
.message("500 message")
.responseModel(new ModelRef("Error"))
.build()))
.securitySchemes(asList(apiKey()))
.securityContexts(asList(securityContext()))
.enableUrlTemplating(true)
// .globalOperationParameters(
// newArrayList(new ParameterBuilder()
// .name("someGlobalParameter")
// .description("Description of someGlobalParameter")
// .modelRef(new ModelRef("string"))
// .parameterType("query")
// .required(true)
// .build()))
// .tags(new Tag("Pet Service", "All apis relating to pets"))
// .additionalModels(typeResolver.resolve(AdditionalModel.class))
;
}