Skip to content
Merged
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 @@ -24,7 +24,8 @@ static Map<String, Object> extractExtensions(Map<String, Object> raw) {

public static Schema parse(Object raw) {
if (raw instanceof Boolean b) {
return b ? new AlwaysSchema(Map.of()) : new NeverSchema(Map.of());
boolean allow = b;
return allow ? new AlwaysSchema(Map.of()) : new NeverSchema(Map.of());
}
if (raw instanceof Map<?, ?> map) {
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -208,7 +209,8 @@ private static ArraySchema parseArray(Map<String, Object> raw, Set<TypeName> typ
if (itemsRaw == null) {
itemSchema = new NullSchema(Map.of());
} else if (itemsRaw instanceof Boolean b) {
itemSchema = b ? new AlwaysSchema(Map.of()) : new NeverSchema(Map.of());
boolean allow = b;
itemSchema = allow ? new AlwaysSchema(Map.of()) : new NeverSchema(Map.of());
} else {
Map<String, Object> items = (Map<String, Object>) itemsRaw;
itemSchema = items.isEmpty() ? new NullSchema(Map.of()) : parse(items);
Expand Down
Loading