springboot集成swagger2时api不显示问题
我的swagger与引用工程不再一个子模块下,需要先引入pom中



这是错误代码
@SpringBootApplication
@ComponentScan(basePackages = "com.xuda.yygh.common.utils")
public class ServiceHospApplication {
public static void main(String[] args) {
SpringApplication.run(ServiceHospApplication.class,args);
}
}
修改之后,
在pllication.properties里面加上下面的一句
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
在springboot的2.6.6版本中不需要进行扫描swagger所在的模块,所以不用加上@ComponentScan,
@SpringBootApplication
//@ComponentScan(basePackages = "com.xuda.yygh.common.utils")
public class ServiceHospApplication {
public static void main(String[] args) {
SpringApplication.run(ServiceHospApplication.class,args);
}
}

2630

被折叠的 条评论
为什么被折叠?



