diff --git a/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/openapi/utils/OpenApiUtil.java b/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/openapi/utils/OpenApiUtil.java index 04c140f1..e8704e1c 100644 --- a/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/openapi/utils/OpenApiUtil.java +++ b/multiapi-engine/src/main/java/com/sngular/api/generator/plugin/openapi/utils/OpenApiUtil.java @@ -59,10 +59,7 @@ private static MultiValuedMap> mapApiGroupsByTags( final MultiValuedMap> mapApis = new ArrayListValuedHashMap<>(); while (pathList.hasNext()) { final Entry openAPIPath = pathList.next(); - final var mapMethodsByTag = getMapMethodsByTag(openAPIPath); - for (Entry> tagMethodEntry : mapMethodsByTag.entries()) { - mapApis.put(tagMethodEntry.getKey(), tagMethodEntry.getValue()); - } + mapApis.putAll(getMapMethodsByTag(openAPIPath)); } return mapApis; @@ -75,8 +72,8 @@ private static MultiValuedMap> getMapMethodsByTag( while (operations.hasNext()) { final var method = operations.next(); if (ApiTool.hasNode(method.getValue(), "tags")) { - final var tag = ApiTool.getNode(method.getValue(), "tags").elements().next(); - mapByTag.put(tag.asText(), Map.of(pathItem.getKey(), new ObjectNode(JsonNodeFactory.instance, Map.ofEntries(method)))); + final var tag = ApiTool.getNode(method.getValue(), "tags").elements().next().asText(); + mapByTag.put(tag, Map.of(pathItem.getKey(), new ObjectNode(JsonNodeFactory.instance, Map.ofEntries(method)))); } } return mapByTag;