Skip to content

Commit ceec140

Browse files
committed
changed different line separators in AsciiDocRender.java to make it consistent
1 parent a674aa1 commit ceec140

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

core/src/main/java/org/openapitools/openapidiff/core/output/AsciidocRender.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ public void render(ChangedOpenApi diff, OutputStreamWriter outputStreamWriter) {
3232
bigTitle(
3333
diff.getNewSpecOpenApi().getInfo().getTitle(),
3434
diff.getNewSpecOpenApi().getInfo().getVersion()));
35-
safelyAppend(outputStreamWriter, System.lineSeparator());
36-
safelyAppend(outputStreamWriter, System.lineSeparator());
35+
safelyAppend(outputStreamWriter, "\n");
36+
safelyAppend(outputStreamWriter, "\n");
3737
safelyAppend(outputStreamWriter, "NOTE: No differences. Specifications are equivalents");
3838
} else {
3939
safelyAppend(
4040
outputStreamWriter,
4141
bigTitle(
4242
diff.getNewSpecOpenApi().getInfo().getTitle(),
4343
diff.getNewSpecOpenApi().getInfo().getVersion()));
44-
safelyAppend(outputStreamWriter, System.lineSeparator());
44+
safelyAppend(outputStreamWriter, "\n");
4545
safelyAppend(outputStreamWriter, ":reproducible:\n:sectlinks:\n:toc:\n");
46-
safelyAppend(outputStreamWriter, System.lineSeparator());
46+
safelyAppend(outputStreamWriter, "\n");
4747

4848
List<Endpoint> newEndpoints = diff.getNewEndpoints();
4949
listEndpoints(newEndpoints, "What's New", outputStreamWriter);
@@ -57,13 +57,13 @@ public void render(ChangedOpenApi diff, OutputStreamWriter outputStreamWriter) {
5757
List<ChangedOperation> changedOperations = diff.getChangedOperations();
5858
ol_changed(changedOperations, outputStreamWriter);
5959

60-
safelyAppend(outputStreamWriter, System.lineSeparator());
60+
safelyAppend(outputStreamWriter, "\n");
6161
safelyAppend(
6262
outputStreamWriter,
6363
diff.isCompatible()
6464
? "NOTE: API changes are backward compatible"
6565
: "WARNING: API changes broke backward compatibility");
66-
safelyAppend(outputStreamWriter, System.lineSeparator());
66+
safelyAppend(outputStreamWriter, "\n");
6767
}
6868
try {
6969
outputStreamWriter.close();
@@ -78,7 +78,7 @@ private void ol_changed(
7878
return;
7979
}
8080
safelyAppend(outputStreamWriter, title("What's Changed", 2));
81-
safelyAppend(outputStreamWriter, System.lineSeparator());
81+
safelyAppend(outputStreamWriter, "\n");
8282
for (ChangedOperation operation : operations) {
8383
String pathUrl = operation.getPathUrl();
8484
String method = operation.getHttpMethod().toString();
@@ -89,18 +89,18 @@ private void ol_changed(
8989
if (result(operation.getParameters()).isDifferent()) {
9090
safelyAppend(outputStreamWriter, "* Parameter:\n");
9191
safelyAppend(outputStreamWriter, ul_param(operation.getParameters()));
92-
safelyAppend(outputStreamWriter, System.lineSeparator());
92+
safelyAppend(outputStreamWriter, "\n");
9393
}
9494
if (operation.resultRequestBody().isDifferent()) {
9595
safelyAppend(outputStreamWriter, "* Request:\n");
9696
safelyAppend(
9797
outputStreamWriter, ul_content(operation.getRequestBody().getContent(), true, 2));
98-
safelyAppend(outputStreamWriter, System.lineSeparator());
98+
safelyAppend(outputStreamWriter, "\n");
9999
}
100100
if (operation.resultApiResponses().isDifferent()) {
101101
safelyAppend(outputStreamWriter, "* Return Type:\n");
102102
safelyAppend(outputStreamWriter, ul_response(operation.getApiResponses()));
103-
safelyAppend(outputStreamWriter, System.lineSeparator());
103+
safelyAppend(outputStreamWriter, "\n");
104104
}
105105
}
106106
}
@@ -226,7 +226,7 @@ protected String property(String name, String title, Schema<?> schema) {
226226
}
227227

228228
protected String property(String name, String title, String type) {
229-
return String.format("*** %s: %s (%s)%n\n", title, name, type);
229+
return String.format("*** %s: %s (%s)\n\n", title, name, type);
230230
}
231231

232232
protected Schema<?> resolve(Schema<?> schema) {
@@ -264,7 +264,7 @@ private String ul_param(ChangedParameters changedParameters) {
264264
}
265265

266266
private String itemParam(String title, Parameter param) {
267-
return title + param.getName() + " in " + param.getIn() + System.lineSeparator();
267+
return title + param.getName() + " in " + param.getIn() + "\n";
268268
}
269269

270270
private String li_changedParam(ChangedParameter changeParam) {
@@ -287,11 +287,11 @@ private String listEndpoints(
287287
itemEndpoint(
288288
endpoint.getMethod().toString(), endpoint.getPathUrl(), endpoint.getSummary()));
289289
}
290-
return sb.append(System.lineSeparator()).toString();
290+
return sb.append("\n").toString();
291291
}
292292

293293
private String itemEndpoint(String method, String path, String desc) {
294-
return String.format("=== %s%s%n", StringUtils.rightPad(method, 6), path);
294+
return String.format("=== %s%s\n", StringUtils.rightPad(method, 6), path);
295295
}
296296

297297
public String bigTitle(String title, String version) {

0 commit comments

Comments
 (0)