Skip to content

Commit

Permalink
[ISSUE apache#4988] Fix swagger doc registered appName use contextPath
Browse files Browse the repository at this point in the history
  • Loading branch information
GOODBOY008 committed Aug 10, 2023
1 parent 0f83b53 commit e712d58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.Set;
import javax.annotation.Resource;

import io.vertx.core.json.Json;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ public void registerApiDocument(final ApiDocRegisterDTO apiDocRegisterDTO) {
tags = apiDocRegisterDTO.getTags();
}
for (String tag : tags) {
// tag is contextPath,so remove first char '/'
tag = tag.substring(1);
List<TagVO> byQuery = tagService.findByQuery(tag);
// tag value is contextPath,so remove first char '/'
String appName = tag.substring(1);
List<TagVO> byQuery = tagService.findByQuery(appName);
if (CollectionUtils.isNotEmpty(byQuery)) {
tagsIds.addAll(byQuery.stream().map(TagVO::getId).collect(Collectors.toList()));
} else {
TagDTO tagDTO = new TagDTO();
String id = UUIDUtils.getInstance().generateShortUuid();
tagDTO.setTagDesc(tag);
tagDTO.setName(tag);
tagDTO.setTagDesc(appName);
tagDTO.setName(appName);
tagDTO.setId(id);
tagService.createRootTag(tagDTO, null);
tagsIds.add(id);
Expand Down

0 comments on commit e712d58

Please sign in to comment.