Skip to content

Commit 3d28e8d

Browse files
committed
Avoid including prefixes for unknown changes
1 parent ae1d05b commit 3d28e8d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/main/java/com/qdesrame/openapi/diff/output/ConsoleRender.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import java.util.List;
99
import java.util.Map;
1010
import java.util.Optional;
11-
import java.util.stream.Collectors;
1211
import org.apache.commons.httpclient.HttpStatus;
1312
import org.apache.commons.lang3.StringUtils;
1413

@@ -188,6 +187,7 @@ private void incompatibility(
188187
.append(StringUtils.repeat(' ', 10))
189188
.append("Missing property: ")
190189
.append(propPrefix)
190+
.append(".")
191191
.append(propName)
192192
.append(System.lineSeparator());
193193
});
@@ -199,18 +199,18 @@ private void incompatibility(
199199

200200
String description = null;
201201
if (!cs.getChangedProperties().isEmpty()) {
202-
description = cs.getChangedProperties().keySet().stream().collect(Collectors.joining());
202+
cs.getChangedProperties().entrySet().stream()
203+
.forEach(
204+
(entry) -> {
205+
incompatibility(
206+
output,
207+
entry.getValue(),
208+
propPrefix + (propPrefix.isEmpty() ? "" : ".") + entry.getKey());
209+
});
203210
} else if (cs.getItems() != null) {
204-
description = "[n]";
211+
incompatibility(output, cs.getItems(), propPrefix + "[n]");
205212
}
206-
final String prefix = propPrefix + description + ".";
207-
cs.getChangedElements().stream()
208-
.forEach(
209-
(c) -> {
210-
if (c != null && c instanceof ComposedChanged) {
211-
incompatibility(output, (ComposedChanged) c, prefix);
212-
}
213-
});
213+
214214
return;
215215
}
216216

0 commit comments

Comments
 (0)