Skip to content

Commit f335920

Browse files
committed
Fixes #190 - OneOfValidator cannot validate object with multiple properties
1 parent 417ffb3 commit f335920

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ public Set<ValidationMessage> validate(JsonNode node, JsonNode rootNode, String
141141

142142
// validate that only a single element has been received in the oneOf node
143143
// validation should not continue, as it contradicts the oneOf requirement of only one
144-
if(node.isObject() && node.size()>1) {
145-
errors = Collections.singleton(buildValidationMessage(at, ""));
146-
return Collections.unmodifiableSet(errors);
147-
}
144+
// if(node.isObject() && node.size()>1) {
145+
// errors = Collections.singleton(buildValidationMessage(at, ""));
146+
// return Collections.unmodifiableSet(errors);
147+
// }
148148

149149
for (ShortcutValidator validator : schemas) {
150150
if (!validator.allConstantsMatch(node)) {

0 commit comments

Comments
 (0)