Skip to content

Support boolean values for additionalProperties #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 30, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ private void compareAdditionalProperties(
Object left = leftSchema.getAdditionalProperties();
Object right = rightSchema.getAdditionalProperties();
if (left instanceof Schema || right instanceof Schema) {
Schema leftAdditionalSchema = (Schema) left;
Schema rightAdditionalSchema = (Schema) right;
Schema leftAdditionalSchema = left instanceof Schema ? (Schema) left : null;
Schema rightAdditionalSchema = right instanceof Schema ? (Schema) right : null;
ChangedSchema apChangedSchema =
new ChangedSchema()
.setContext(context)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.openapitools.openapidiff.core;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.openapitools.openapidiff.core.model.ChangedOpenApi;
import org.openapitools.openapidiff.core.output.ConsoleRender;

class AdditionalPropertiesTest {
@Test
void booleanAdditionalPropertiesAreSupported() {
ChangedOpenApi diff = OpenApiCompare.fromLocations("issue-256_1.json", "issue-256_2.json");
ConsoleRender render = new ConsoleRender();
assertThat(render.render(diff)).isNotBlank();
}
}
Loading