Java 类springfox.documentation.builders.PathSelectors 实例源码

项目:X-mall    文件:Swagger2Config.java   
@Bean
public Docket createRestApi() {
    ParameterBuilder tokenPar = new ParameterBuilder();
    List<Parameter> parameters = new ArrayList<>();
    tokenPar.name("xmall-Token")
            .description("token")
            .defaultValue("admin")
            .modelRef(new ModelRef("string"))
            .parameterType("header")
            .required(false)
            .build();
    parameters.add(tokenPar.build());
    Docket docket = new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .useDefaultResponseMessages(false)
            .globalOperationParameters(parameters)
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.jeiker.mall.controller"))
            .paths(PathSelectors.any())
            .build();
    return docket;
}
项目:swagger2-spring-boot-starter    文件:Swagger2AutoConfiguration.java   
private Predicate<String> paths(Swagger2Properties swagger2Properties) {

        List<Predicate<String>> basePaths = new ArrayList<>();

        if (swagger2Properties.getBasePath().isEmpty()) {
            basePaths.add(PathSelectors.any());
        }
        for (String basePath : swagger2Properties.getBasePath()) {
            basePaths.add(PathSelectors.ant(basePath));
        }

        List<Predicate<String>> excludePaths = new ArrayList<>();
        for (String excludePath : swagger2Properties.getExcludePath()) {
            excludePaths.add(PathSelectors.ant(excludePath));
        }

        return Predicates.and(
            Predicates.not(
                Predicates.or(excludePaths)
            ),
            Predicates.or(basePaths)
        );
    }
项目:spring-backend-boilerplate    文件:SpringfoxConfiguration.java   
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);
}
项目:spring-boot-oauth2-demo    文件:SpringfoxConfig.java   
@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"));
}
项目:plumdo-work    文件:Swagger2Configuration.java   
@Bean
public Docket createRestApi() {

    return new Docket(DocumentationType.SWAGGER_2)
            .useDefaultResponseMessages(false)
            .additionalModels(typeResolver.resolve(ErrorInfo.class))
            .globalResponseMessage(RequestMethod.GET, getDefaultResponseMessage())
            .globalResponseMessage(RequestMethod.POST, getDefaultResponseMessage())
            .globalResponseMessage(RequestMethod.PUT, getDefaultResponseMessage())
            .globalResponseMessage(RequestMethod.DELETE, getDefaultResponseMessage())
            .directModelSubstitute(Timestamp.class, Date.class)
            .tags(new Tag("默认标签", "定义全局默认标签"),getTags())
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.plumdo.form"))
            .paths(PathSelectors.any())
            .build();
}
项目:plumdo-work    文件:Swagger2Configuration.java   
@Bean
public Docket createRestApi() {

    return new Docket(DocumentationType.SWAGGER_2)
            .useDefaultResponseMessages(false)
            .globalResponseMessage(RequestMethod.GET, getDefaultResponseMessage())
            .globalResponseMessage(RequestMethod.POST, getDefaultResponseMessage())
            .globalResponseMessage(RequestMethod.PUT, getDefaultResponseMessage())
            .globalResponseMessage(RequestMethod.DELETE, getDefaultResponseMessage())
            .directModelSubstitute(Timestamp.class, Date.class)
            .tags(new Tag("默认标签", "定义全局默认标签"),getTags())
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.plumdo.form"))
            .paths(PathSelectors.any())
            .build();
}
项目:C4SG-Obsolete    文件:SwaggerConfig.java   
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .useDefaultResponseMessages(false)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(Predicates.not(PathSelectors.regex("/error.*")))
            .build();
}
项目:spring5-rest-api    文件:SwaggerConfig.java   
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            //                .apis(RequestHandlerSelectors.any()) // show all service, including spring-boot default.
            .apis(RequestHandlerSelectors.basePackage("com.mkdika.spring5restapi.web.api")) // show specific class path only                 
            .paths(PathSelectors.any())
            .build()
            .apiInfo(metaInfo());
}
项目:danyuan-application    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("tk.ainiyue.danyuan"))
            .paths(PathSelectors.any())
            .build();
}
项目:Plum    文件:Swagger2Config.java   
@Bean
public Docket apiDocket() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("org.java10.plum.controllers"))
            .paths(PathSelectors.any())
            .build();
}
项目:mirrorgate    文件:OpenApiConfig.java   
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.bbva.arq.devops.ae.mirrorgate.api"))
            .paths(PathSelectors.any())
            .build();
}
项目:SpringBootStudy    文件:Swagger2Config.java   
@Bean
public Docket createRestApi() {
    Docket docket = new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.jeiker.demo.controller"))
            .paths(PathSelectors.any())
            .build();
    return docket;
}
项目:xbin-store    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage(basePackage))
            .paths(PathSelectors.any())
            .build();
}
项目:xbin-store    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage(basePackage))
            .paths(PathSelectors.any())
            .build();
}
项目:xbin-store    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage(basePackage))
            .paths(PathSelectors.any())
            .build();
}
项目:java-api-best-practices    文件:SwaggerConfiguration.java   
@Bean
public Docket api() {
  String host = environment.getRequiredProperty("application.apiBaseFullPath");
  if (host.contains("://")) {
    host = host.substring(host.indexOf("://") + 3, host.length());
  }
  return new Docket(DocumentationType.SWAGGER_2)
      .host(host)
      .pathProvider(new CustomPathProvider())
      .select()
      .apis(RequestHandlerSelectors.any())
      .paths(PathSelectors.any())
      .build();
}
项目:xbin-store    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage(basePackage))
            .paths(PathSelectors.any())
            .build();
}
项目:xbin-store    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage(basePackage))
            .paths(PathSelectors.any())
            .build();
}
项目:mumu-swagger    文件:SwaggerConfig.java   
/**
 * Create rest api docket.
 *
 * @return the docket
 */
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            //.groupName("用户管理")
            .forCodeGeneration(true)
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.lovecws.mumu.swagger"))
            .paths(PathSelectors.any())
            .build();
}
项目:demo-springboot    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("vip.fanrong"))
            .paths(PathSelectors.any())
            .build();
}
项目:amv-access-api-poc    文件:SwaggerConfiguration.java   
@Bean
public Docket internal() {
    return new Docket(DocumentationType.SWAGGER_2)
            .groupName("internal")
            .select()
            .apis(withClassAnnotation(RestController.class))
            .paths(PathSelectors.regex("/internal/.+"))
            .build()
            .apiInfo(apiInfo());
}
项目:amv-access-api-poc    文件:SwaggerConfiguration.java   
@Bean
public Docket models() {
    return new Docket(DocumentationType.SWAGGER_2)
            .groupName("models")
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(PathSelectors.regex("/model-.+"))
            .build()
            .apiInfo(apiInfo());
}
项目:amv-access-api-poc    文件:SwaggerConfiguration.java   
@Bean
public Docket all() {
    return new Docket(DocumentationType.SWAGGER_2)
            .groupName("all")
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(PathSelectors.any())
            .build()
            .apiInfo(apiInfo());
}
项目:kbase-doc    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.eastrobot.web"))
            .paths(PathSelectors.any())
            .build();
}
项目:petstore-inventory    文件:InventoryApplication.java   
@Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build();
//      /swagger-ui.html
    }
项目:spring-boot-template    文件:SwaggerConfiguration.java   
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
        .useDefaultResponseMessages(false)
        .select()
        .apis(RequestHandlerSelectors.basePackage(Application.class.getPackage().getName() + ".controllers"))
        .paths(PathSelectors.any())
        .build();
}
项目:spring-boot-seed    文件:SwaggerConfig.java   
/**
 * Api docket.
 *
 * @return the docket
 */
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
            .paths(PathSelectors.any())
            .build()
            .apiInfo(aipInfo());
}
项目:hauth-java    文件:SwaggerConfig.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.asofdate.hauth.controller"))
            .paths(PathSelectors.any())
            .build();
}
项目:projectindoorweb    文件:IndoorApiDescriptionHelper.java   
/**
 * 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());
}
项目:JavaQuarkBBS    文件:Swagger2Configuration.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.quark.rest.controller"))
            .paths(PathSelectors.any())
            .build();
}
项目:microservices-spring    文件:SwaggerConfig.java   
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(PathSelectors.any())
            .build();
}
项目:microservices-spring    文件:SwaggerConfig.java   
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(PathSelectors.any())
            .build();
}
项目:microservices-spring    文件:SwaggerConfig.java   
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(PathSelectors.any())
            .build();
}
项目:LushX    文件:SwaggerConfig.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("cn.mailu.lushx"))
            .paths(PathSelectors.any())
            .build();
}
项目:springboot-smart    文件:Swagger2.java   
@Bean
    public Docket createRestApi() {
//      return new Docket(DocumentationType.SWAGGER_2)
//              .apiInfo(apiInfo())
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("org.zt.ccty.springboot_mybatis_demo.controller"))
                .paths(PathSelectors.any())
                .build();
    }
项目:digag-server    文件:Swagger2.java   
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.digag.web"))
            .paths(PathSelectors.any())
            .build();
}
项目:cerebro    文件:App.java   
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
        .apis(RequestHandlerSelectors.basePackage("com.vsct.supervision")).paths(PathSelectors.any()).build()
        .useDefaultResponseMessages(false).globalResponseMessage(RequestMethod.GET, responseMessageList())
        .globalResponseMessage(RequestMethod.DELETE, responseMessageList())
        .globalResponseMessage(RequestMethod.POST, responseMessageList())
        .globalResponseMessage(RequestMethod.PUT, responseMessageList());
}
项目:open-kilda    文件:SwaggerConfig.java   
/**
 * Swagger configuration.
 *
 * @return {@link Docket} instance
 */
@Bean
public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .enableUrlTemplating(true)
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(Predicates.not(PathSelectors.regex("/error.*")))
            .build();
}