new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.basePackage("com.xxxx.controller")) // 扫描包 //.apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) // 扫描类注解 //.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) //扫描方法注解 .paths(PathSelectors.any()) .build();
转载于:https://my.oschina.net/aoaoH/blog/3058619