Skip to content

Commit 7c9125f

Browse files
committed
fixed failing test
1 parent 50a1763 commit 7c9125f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/OpenAPIDeserializer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,18 @@ public List<Tag> getTagList(ArrayNode obj, String location, ParseResult result)
293293
return null;
294294
}
295295
List<Tag> tags = new ArrayList<>();
296+
Set<String> tagsTracker = new HashSet<>();
296297
for (JsonNode item : obj) {
297298
if (item.getNodeType().equals(JsonNodeType.OBJECT)) {
298299
Tag tag = getTag((ObjectNode) item, location, result);
299300
if (tag != null) {
300301
tags.add(tag);
301-
if(tags.stream().filter(o -> o.getName().equals(tag.getName())).findFirst().isPresent()) {
302+
303+
if(tagsTracker.contains((String)tag.getName())) {
302304
result.uniqueTags(location,tag.getName());
303305
}
304306

307+
tagsTracker.add(tag.getName());
305308
}
306309
}
307310
}

0 commit comments

Comments
 (0)