Skip to content

Commit 8852fe5

Browse files
committed
Fixes #185 Validation issue in oneOf when elements have optional fields
1 parent c26d997 commit 8852fe5

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@ public class ValidatorState {
55
* Flag set when a node has matched Works in conjunction with the next flag:
66
* isComplexValidator, to be used for complex validators such as oneOf, for ex
77
*/
8-
private boolean matchedNode = true;
8+
private boolean matchedNode = true;
99

1010
/**
1111
* Flag set if complex validators such as oneOf, for ex, neeed to have their
1212
* properties validated. The PropertiesValidator is not aware generally of a
1313
* complex validator is being validated or a simple poperty tree
1414
*/
15-
private boolean isComplexValidator = false;
15+
private boolean isComplexValidator = false;
1616

1717
public void setMatchedNode(boolean matchedNode) {
18-
this.matchedNode = matchedNode;
18+
this.matchedNode = matchedNode;
1919
}
20+
2021
public boolean hasMatchedNode() {
21-
return matchedNode;
22+
return matchedNode;
23+
}
24+
25+
public boolean isComplexValidator() {
26+
return isComplexValidator;
2227
}
2328

24-
public boolean isComplexValidator() {
25-
return isComplexValidator;
26-
}
29+
public void setComplexValidator(boolean isComplexValidator) {
30+
this.isComplexValidator = isComplexValidator;
31+
}
2732

28-
public void setComplexValidator(boolean isComplexValidator) {
29-
this.isComplexValidator = isComplexValidator;
30-
}
31-
3233
}

0 commit comments

Comments
 (0)