[swagger2]匹配多个controller,不能多个路径的

.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
  • https://www.cnblogs.com/acm-bingzi/p/swagger2-controller.html

多个路径方法:

        com.google.common.base.Predicate selector1 = RequestHandlerSelectors.basePackage("com.asiainfo.path.controller");
        com.google.common.base.Predicate selector2 = RequestHandlerSelectors.basePackage("com.asiainfo.billing.controller");
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
//                .apis(RequestHandlerSelectors.basePackage("com.asiainfo.path.controller"))
//                .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))// 显示自己写的全部controller,不包含系统的
                .apis(Predicates.or(selector1,selector2))
                .paths(PathSelectors.any())
                .build();
  • https://www.oschina.net/question/3662407_2274273 好回答

转载于:https://my.oschina.net/u/2464371/blog/3083451

你可能感兴趣的:([swagger2]匹配多个controller,不能多个路径的)