Skip to content

Commit a2ceca4

Browse files
committed
chore: code formatting
1 parent 2c34b3d commit a2ceca4

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

cli/src/main/java/org/openapitools/openapidiff/cli/Main.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ public static void main(String... args) {
119119
.desc("export diff as html in given file with incompatible changes")
120120
.build());
121121
options.addOption(
122-
Option.builder()
123-
.longOpt("html-detailed")
124-
.hasArg()
125-
.argName("file")
126-
.desc("export diff as html in given file with all changes")
127-
.build());
122+
Option.builder()
123+
.longOpt("html-detailed")
124+
.hasArg()
125+
.argName("file")
126+
.desc("export diff as html in given file with all changes")
127+
.build());
128128
options.addOption(
129129
Option.builder()
130130
.longOpt("text")

core/src/main/java/org/openapitools/openapidiff/core/model/ChangedOperation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public DiffResult resultApiResponses() {
6363
public DiffResult resultRequestBody() {
6464
return requestBody == null ? DiffResult.NO_CHANGES : requestBody.isChanged();
6565
}
66+
6667
public DiffResult resultSecurityRequirements() {
6768
return securityRequirements == null ? DiffResult.NO_CHANGES : securityRequirements.isChanged();
6869
}

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

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ private OlTag ol_changed(List<ChangedOperation> changedOperations) {
217217
}
218218
if (showAllChanges && changedOperation.resultSecurityRequirements().isDifferent()) {
219219
ul_detail.with(
220-
li().with(h3("Security Requirements"))
221-
.with(ul_securityRequirements(changedOperation.getSecurityRequirements())));
220+
li().with(h3("Security Requirements"))
221+
.with(ul_securityRequirements(changedOperation.getSecurityRequirements())));
222222
}
223223
ol.with(
224224
li().with(span(method).withClass(method))
@@ -255,24 +255,24 @@ private UlTag ul_securityRequirements(ChangedSecurityRequirements changedSecurit
255255

256256
private LiTag li_addSecurityRequirement(SecurityRequirement securityRequirement) {
257257
return li().withText("New security requirement : ")
258-
.with(span(null == securityRequirement.toString() ? "" : (securityRequirement.toString())));
258+
.with(span(null == securityRequirement.toString() ? "" : (securityRequirement.toString())));
259259
}
260260

261261
private LiTag li_missingSecurityRequirement(SecurityRequirement securityRequirement) {
262262
return li().withText("Deleted security requirement : ")
263-
.with(span(null == securityRequirement.toString() ? "" : (securityRequirement.toString())));
263+
.with(span(null == securityRequirement.toString() ? "" : (securityRequirement.toString())));
264264
}
265265

266266
private LiTag li_changedSecurityRequirement(
267-
ChangedSecurityRequirement changedSecurityRequirement) {
267+
ChangedSecurityRequirement changedSecurityRequirement) {
268268
return li().withText(String.format("Changed security requirement : "))
269-
.with(
270-
span(
271-
(null == changedSecurityRequirement.getNewSecurityRequirement()
272-
|| null
273-
== changedSecurityRequirement.getNewSecurityRequirement().toString())
274-
? ""
275-
: (changedSecurityRequirement.getNewSecurityRequirement().toString())));
269+
.with(
270+
span(
271+
(null == changedSecurityRequirement.getNewSecurityRequirement()
272+
|| null
273+
== changedSecurityRequirement.getNewSecurityRequirement().toString())
274+
? ""
275+
: (changedSecurityRequirement.getNewSecurityRequirement().toString())));
276276
}
277277

278278
private UlTag ul_response(ChangedApiResponse changedApiResponse) {
@@ -347,8 +347,7 @@ private LiTag li_changedRequest(String name, ChangedMediaType request) {
347347
.withText(String.format("Changed body: '%s'", name));
348348
if (request.isIncompatible() && !showAllChanges) {
349349
incompatibilities(li, request.getSchema());
350-
}
351-
else if (showAllChanges) {
350+
} else if (showAllChanges) {
352351
allChanges(li, request.getSchema());
353352
}
354353
return li;
@@ -365,21 +364,21 @@ private void allChanges(final LiTag output, final ChangedSchema schema) {
365364
}
366365

367366
private void allChanges(
368-
final ContainerTag<?> output, String propName, final ChangedSchema schema) {
367+
final ContainerTag<?> output, String propName, final ChangedSchema schema) {
369368
String prefix = propName.isEmpty() ? "" : propName + ".";
370369
properties(
371-
output, prefix, "Missing property", schema.getMissingProperties(), schema.getContext());
370+
output, prefix, "Missing property", schema.getMissingProperties(), schema.getContext());
372371
properties(
373-
output, prefix, "Added property", schema.getIncreasedProperties(), schema.getContext());
372+
output, prefix, "Added property", schema.getIncreasedProperties(), schema.getContext());
374373

375374
propertiesChanged(
376-
output, prefix, "Changed property", schema.getChangedProperties(), schema.getContext());
375+
output, prefix, "Changed property", schema.getChangedProperties(), schema.getContext());
377376
if (schema.getItems() != null) {
378377
itemsAllChanges(output, propName, schema.getItems());
379378
}
380379
schema
381-
.getChangedProperties()
382-
.forEach((name, property) -> allChanges(output, prefix + name, property));
380+
.getChangedProperties()
381+
.forEach((name, property) -> allChanges(output, prefix + name, property));
383382
}
384383

385384
private void incompatibilities(final LiTag output, final ChangedSchema schema) {
@@ -423,11 +422,11 @@ private void properties(
423422
}
424423

425424
private void propertiesChanged(
426-
ContainerTag<?> output,
427-
String propPrefix,
428-
String title,
429-
Map<String, ChangedSchema> properties,
430-
DiffContext context) {
425+
ContainerTag<?> output,
426+
String propPrefix,
427+
String title,
428+
Map<String, ChangedSchema> properties,
429+
DiffContext context) {
431430
if (properties != null) {
432431
properties.forEach((key, value) -> resolveProperty(output, propPrefix, key, value, title));
433432
}
@@ -443,7 +442,7 @@ private void resolveProperty(
443442
}
444443

445444
private void resolveProperty(
446-
ContainerTag<?> output, String propPrefix, String key, ChangedSchema value, String title) {
445+
ContainerTag<?> output, String propPrefix, String key, ChangedSchema value, String title) {
447446
try {
448447
property(output, propPrefix + key, title, resolve(value));
449448
} catch (Exception e) {
@@ -466,9 +465,9 @@ protected Schema<?> resolve(Schema<?> schema) {
466465

467466
protected Schema<?> resolve(ChangedSchema schema) {
468467
return refPointer.resolveRef(
469-
diff.getNewSpecOpenApi().getComponents(),
470-
schema.getNewSchema(),
471-
schema.getNewSchema().get$ref());
468+
diff.getNewSpecOpenApi().getComponents(),
469+
schema.getNewSchema(),
470+
schema.getNewSchema().get$ref());
472471
}
473472

474473
protected String type(Schema<?> schema) {

core/src/test/java/org/openapitools/openapidiff/core/ConsoleRenderTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public void renderDoesNotFailWhenPropertyHasBeenRemoved() {
1414
ConsoleRender render = new ConsoleRender();
1515
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
1616
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
17-
ChangedOpenApi diff = OpenApiCompare.fromLocations("missing_property_1.yaml", "missing_property_2.yaml");
17+
ChangedOpenApi diff =
18+
OpenApiCompare.fromLocations("missing_property_1.yaml", "missing_property_2.yaml");
1819
render.render(diff, outputStreamWriter);
1920
assertThat(outputStream.toString()).isNotBlank();
2021
}
@@ -36,7 +37,7 @@ public void renderShowsWhatsDeletedSectionWhenEndpointIsDeleted() {
3637
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
3738
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
3839
ChangedOpenApi diff =
39-
OpenApiCompare.fromLocations("delete_endpoint_1.yaml", "delete_endpoint_2.yaml");
40+
OpenApiCompare.fromLocations("delete_endpoint_1.yaml", "delete_endpoint_2.yaml");
4041
render.render(diff, outputStreamWriter);
4142
assertThat(outputStream.toString()).contains("What's Deleted");
4243
}
@@ -47,7 +48,7 @@ public void renderShowsWhatsNewSectionWhenEndpointIsAdded() {
4748
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
4849
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
4950
ChangedOpenApi diff =
50-
OpenApiCompare.fromLocations("add_endpoint_1.yaml", "add_endpoint_2.yaml");
51+
OpenApiCompare.fromLocations("add_endpoint_1.yaml", "add_endpoint_2.yaml");
5152
render.render(diff, outputStreamWriter);
5253
assertThat(outputStream.toString()).contains("What's New");
5354
}
@@ -58,7 +59,7 @@ public void renderShowsWhatsDeprecatedSectionWhenEndpointIsDeprecated() {
5859
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
5960
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
6061
ChangedOpenApi diff =
61-
OpenApiCompare.fromLocations("deprecate_endpoint_1.yaml", "deprecate_endpoint_2.yaml");
62+
OpenApiCompare.fromLocations("deprecate_endpoint_1.yaml", "deprecate_endpoint_2.yaml");
6263
render.render(diff, outputStreamWriter);
6364
assertThat(outputStream.toString()).contains("What's Deprecated");
6465
}
@@ -69,10 +70,10 @@ public void renderShowsWhatsChangedSectionWithCorrectFormattingWhenEndpointIsCha
6970
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
7071
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream);
7172
ChangedOpenApi diff =
72-
OpenApiCompare.fromLocations("change_endpoint_1.yaml", "change_endpoint_2.yaml");
73+
OpenApiCompare.fromLocations("change_endpoint_1.yaml", "change_endpoint_2.yaml");
7374
render.render(diff, outputStreamWriter);
7475
assertThat(outputStream.toString())
75-
.contains("What's Changed")
76-
.containsSubsequence("- GET /widgets", "Parameter:", "- Changed query-param-1 in query");
76+
.contains("What's Changed")
77+
.containsSubsequence("- GET /widgets", "Parameter:", "- Changed query-param-1 in query");
7778
}
7879
}

core/src/test/java/org/openapitools/openapidiff/core/ParameterDiffTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public void issue458ExclusiveMinimumTrueRemoved() {
9191

9292
@Test
9393
public void issue488RenameParameterAddAndRemoveParameterReturnFalse() {
94-
assertOpenApiChangedEndpoints(
95-
"issue-488-1.json", "issue-488-2.json");
94+
assertOpenApiChangedEndpoints("issue-488-1.json", "issue-488-2.json");
9695
}
9796
}

maven/src/main/java/org/openapitools/openapidiff/maven/OpenApiDiffMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class OpenApiDiffMojo extends AbstractMojo {
5656

5757
@Parameter(property = "configProps")
5858
Map<String, String> configProps;
59-
59+
6060
@Parameter(property = "asciidocOutputFileName")
6161
String asciidocOutputFileName;
6262

0 commit comments

Comments
 (0)