解决SpringBoot整合Swagger报错No mapping for GET /aifruit/null/swagger-resources/configuration/security
发布于个人的CSDN上:解决SpringBoot整合Swagger报错No mapping for GET /aifruit/null/swagger-resources/configuration/security
问题
解决
/**
* 解决swagger死循环问题
* 视具体情况用,若控制台报错 No mapping for GET /aifruit/null/swagger-resources/configuration/security
* 则使用下面代码
* 下面这几个地址会一直轮询,改为重定向
* /null/swagger-resources/configuration/ui
* /null/swagger-resources/configuration/security
* /null/swagger-resources
*/
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addRedirectViewController("/null/api-docs",
"/api-docs").setKeepQueryParams(true);
registry.addRedirectViewController("/null/swagger-resources/configuration/ui",
"/swagger-resources/configuration/ui");
registry.addRedirectViewController("/null/swagger-resources/configuration/security",
"/swagger-resources/configuration/security");
registry.addRedirectViewController("/null/swagger-resources", "/swagger-resources");
}
💥 一个正在学习全栈的 💥
⭐ 精神小伙 ⭐
💥 MelodyJerry 💥