Skip to content

Commit 8364aad

Browse files
committed
Added additional validation
1 parent 43aa8c5 commit 8364aad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/com/networknt/schema/OneOfValidator.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,16 @@ public Set<ValidationMessage> validate(JsonNode node, JsonNode rootNode, String
161161
// a valid schema has been identified, and the node was an object, break the loop
162162
if(node.isObject())
163163
break;
164+
} else {
165+
if(node.isObject()) {
166+
if(numberOfValidSchema == 0){
167+
errors.addAll(schemaErrors);
168+
}
169+
170+
break;
171+
}
164172
}
173+
165174
if(numberOfValidSchema == 0){
166175
errors.addAll(schemaErrors);
167176
}

0 commit comments

Comments
 (0)