fix 修复 openapi结构体 因springdoc缓存导致多次拼接接口路径问题

2.X
疯狂的狮子li 2 years ago
parent a9d589167d
commit 6416016024

@ -0,0 +1,15 @@
package com.ruoyi.common.doc.config;
import io.swagger.v3.oas.models.Paths;
/**
* 使便 springdoc
*
* @author Lion Li
*/
public class PlusPaths extends Paths {
public PlusPaths() {
super();
}
}

@ -110,7 +110,10 @@ public class SwaggerAutoConfiguration {
// 对所有路径增加前置上下文路径
return openApi -> {
Paths oldPaths = openApi.getPaths();
Paths newPaths = new Paths();
if (oldPaths instanceof PlusPaths) {
return;
}
PlusPaths newPaths = new PlusPaths();
oldPaths.forEach((k,v) -> newPaths.addPathItem(finalContextPath + k, v));
openApi.setPaths(newPaths);
};

Loading…
Cancel
Save