Skip to content
This repository was archived by the owner on Dec 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ abstract Map<String, Object> buildPathUrlsRequest(ApiConfig apiConfig, ApiMethod
* @return Map of paths
*/
@SuppressWarnings("unchecked")
public Map<String, Object> buildPaths(ApiConfig apiConfig, ApiSchema<ApiDoc> apiSchema, Set<OpenApiTag> tags) {
public Map<String, Object> buildPaths(ApiConfig apiConfig, ApiSchema<ApiDoc> apiSchema, Set<OpenApiTag> tags,
boolean isSwagger) {
Map<String, Object> pathMap = new LinkedHashMap<>(500);

List<ApiDoc> apiDocs = apiSchema.getApiDatas();
Expand All @@ -181,7 +182,7 @@ public Map<String, Object> buildPaths(ApiConfig apiConfig, ApiSchema<ApiDoc> api
String[] paths = methodDoc.getPath().split(";");
for (String path : paths) {
path = path.trim();
if (StringUtil.isNotEmpty(apiConfig.getPathPrefix())) {
if (StringUtil.isNotEmpty(apiConfig.getPathPrefix()) && isSwagger) {
path = path.replace(apiConfig.getPathPrefix(), "");
}
Map<String, Object> request = this.buildPathUrls(apiConfig, methodDoc, methodDoc.getClazzDoc(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void openApiCreate(ApiConfig config, ApiSchema<ApiDoc> apiSchema) {
json.put("servers", buildServers(config));
Set<OpenApiTag> tags = new HashSet<>();
json.put("tags", tags);
json.put("paths", this.buildPaths(config, apiSchema, tags));
json.put("paths", this.buildPaths(config, apiSchema, tags, false));
json.put("components", this.buildComponentsSchema(apiSchema));

String filePath = config.getOutPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void openApiCreate(ApiConfig config, ApiSchema<ApiDoc> apiSchema) {
: DocGlobalConstants.PATH_DELIMITER);
Set<OpenApiTag> tags = new HashSet<>();
json.put("tags", tags);
json.put("paths", buildPaths(config, apiSchema, tags));
json.put("paths", buildPaths(config, apiSchema, tags, true));
json.put("definitions", buildComponentsSchema(apiSchema));

String filePath = config.getOutPath();
Expand Down
Loading