Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: adding response media type is breaking
  • Loading branch information
slinstaedt committed Jan 27, 2022
commit 4c530db082cf40faf33c72fea2e352e7b9c04fad
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public DiffResult isCoreChanged() {
if (increased.isEmpty() && missing.isEmpty()) {
return DiffResult.NO_CHANGES;
}
if (context.isRequest() && missing.isEmpty() || context.isResponse() && increased.isEmpty()) {
if (context.isRequest() && missing.isEmpty() || context.isResponse() && missing.isEmpty()) {
return DiffResult.COMPATIBLE;
}
return DiffResult.INCOMPATIBLE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public void testAddedResponseContentTypeDiff() {
ChangedOpenApi changedOpenApi =
OpenApiCompare.fromLocations(
"content_type_response_add_1.yaml", "content_type_response_add_2.yaml");
assertThat(changedOpenApi.isCompatible()).isFalse();
assertThat(changedOpenApi.isCompatible()).isTrue();
}

@Test
public void testRemovedResponseContentTypeDiff() {
ChangedOpenApi changedOpenApi =
OpenApiCompare.fromLocations(
"content_type_response_add_2.yaml", "content_type_response_add_1.yaml");
assertThat(changedOpenApi.isCompatible()).isTrue();
assertThat(changedOpenApi.isCompatible()).isFalse();
}

@Test
Expand Down