Skip to content

Commit 028710e

Browse files
authored
Optimize logging by creating a debug flag (#1054)
* Optimize debug to reduce array allocation due to var-args * Optimize logging by creating a debug flag
1 parent 2d645e6 commit 028710e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+95
-53
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ The following is sample output from the Hierarchical format.
510510
| `locale` | The locale to use for generating messages in the `ValidationMessage`. Note that this value is copied from `SchemaValidatorsConfig` for each execution. | `Locale.getDefault()`
511511
| `failFast` | Whether to return failure immediately when an assertion is generated. Note that this value is copied from `SchemaValidatorsConfig` for each execution but is automatically set to `true` for the Boolean and Flag output formats. | `false`
512512
| `formatAssertionsEnabled` | The default is to generate format assertions from Draft 4 to Draft 7 and to only generate annotations from Draft 2019-09. Setting to `true` or `false` will override the default behavior. | `null`
513+
| `debugEnabled` | Controls whether debug logging is enabled for logging the node information when processing. Note that this will generate a lot of logs that will affect performance. | `false`
513514

514515
### Schema Validators Configuration
515516

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNo
8888

8989
protected Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
9090
JsonNodePath instanceLocation, boolean walk) {
91-
debug(logger, node, rootNode, instanceLocation);
91+
debug(logger, executionContext, node, rootNode, instanceLocation);
9292
if (!node.isObject()) {
9393
// ignore no object
9494
return Collections.emptySet();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNo
5656
}
5757

5858
protected Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation, boolean walk) {
59-
debug(logger, node, rootNode, instanceLocation);
59+
debug(logger, executionContext, node, rootNode, instanceLocation);
6060

6161
SetView<ValidationMessage> childSchemaErrors = null;
6262

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNo
6060

6161
protected Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
6262
JsonNodePath instanceLocation, boolean walk) {
63-
debug(logger, node, rootNode, instanceLocation);
63+
debug(logger, executionContext, node, rootNode, instanceLocation);
6464

6565
if (this.validationContext.getConfig().isOpenAPI3StyleDiscriminators()) {
6666
executionContext.enterDiscriminatorContext(new DiscriminatorContext(), instanceLocation);

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,23 @@ protected static boolean equals(double n1, double n2) {
9696
return Math.abs(n1 - n2) < 1e-12;
9797
}
9898

99-
protected static void debug(Logger logger, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
100-
logger.debug("validate( {}, {}, {})", node, rootNode, instanceLocation);
99+
public static void debug(Logger logger, ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
100+
JsonNodePath instanceLocation) {
101+
//logger.debug("validate( {}, {}, {})", node, rootNode, instanceLocation);
102+
// The below is equivalent to the above but as there are more than 2 arguments
103+
// the var-arg method is used and an array needs to be allocated even if debug
104+
// is not enabled
105+
if (executionContext.getExecutionConfig().isDebugEnabled() && logger.isDebugEnabled()) {
106+
StringBuilder builder = new StringBuilder();
107+
builder.append("validate( ");
108+
builder.append(node.toString());
109+
builder.append(", ");
110+
builder.append(rootNode.toString());
111+
builder.append(", ");
112+
builder.append(instanceLocation.toString());
113+
builder.append(")");
114+
logger.debug(builder.toString());
115+
}
101116
}
102117

103118
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public ConstValidator(SchemaLocation schemaLocation, JsonNodePath evaluationPath
3434
}
3535

3636
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
37-
debug(logger, node, rootNode, instanceLocation);
37+
debug(logger, executionContext, node, rootNode, instanceLocation);
3838

3939
if (schemaNode.isNumber() && node.isNumber()) {
4040
if (schemaNode.decimalValue().compareTo(node.decimalValue()) != 0) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public ContainsValidator(SchemaLocation schemaLocation, JsonNodePath evaluationP
7272

7373
@Override
7474
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
75-
debug(logger, node, rootNode, instanceLocation);
75+
debug(logger, executionContext, node, rootNode, instanceLocation);
7676

7777
// ignores non-arrays
7878
Set<ValidationMessage> results = null;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private boolean matches(String value) {
6666
@Override
6767
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
6868
JsonNodePath instanceLocation) {
69-
debug(logger, node, rootNode, instanceLocation);
69+
debug(logger, executionContext, node, rootNode, instanceLocation);
7070

7171
// Ignore non-strings
7272
JsonType nodeType = TypeFactory.getValueNodeType(node, this.validationContext.getConfig());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ else if (!PATTERN.matcher(this.contentMediaType).matches()) {
9090
@Override
9191
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
9292
JsonNodePath instanceLocation) {
93-
debug(logger, node, rootNode, instanceLocation);
93+
debug(logger, executionContext, node, rootNode, instanceLocation);
9494

9595
// Ignore non-strings
9696
JsonType nodeType = TypeFactory.getValueNodeType(node, this.validationContext.getConfig());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public DependenciesValidator(SchemaLocation schemaLocation, JsonNodePath evaluat
6363
}
6464

6565
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
66-
debug(logger, node, rootNode, instanceLocation);
66+
debug(logger, executionContext, node, rootNode, instanceLocation);
6767

6868
Set<ValidationMessage> errors = null;
6969

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public DependentRequired(SchemaLocation schemaLocation, JsonNodePath evaluationP
4747
}
4848

4949
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
50-
debug(logger, node, rootNode, instanceLocation);
50+
debug(logger, executionContext, node, rootNode, instanceLocation);
5151

5252
Set<ValidationMessage> errors = new LinkedHashSet<ValidationMessage>();
5353

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNo
5151

5252
protected Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
5353
JsonNodePath instanceLocation, boolean walk) {
54-
debug(logger, node, rootNode, instanceLocation);
54+
debug(logger, executionContext, node, rootNode, instanceLocation);
5555

5656
Set<ValidationMessage> errors = null;
5757
for (Iterator<String> it = node.fieldNames(); it.hasNext(); ) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private static String resolve(JsonSchema parentSchema, String refValue) {
9393

9494
@Override
9595
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
96-
debug(logger, node, rootNode, instanceLocation);
96+
debug(logger, executionContext, node, rootNode, instanceLocation);
9797
JsonSchema refSchema = this.schema.getSchema();
9898
if (refSchema == null) {
9999
ValidationMessage validationMessage = message().type(ValidatorTypeCode.DYNAMIC_REF.getValue())
@@ -107,7 +107,7 @@ public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNo
107107

108108
@Override
109109
public Set<ValidationMessage> walk(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation, boolean shouldValidateSchema) {
110-
debug(logger, node, rootNode, instanceLocation);
110+
debug(logger, executionContext, node, rootNode, instanceLocation);
111111
// This is important because if we use same JsonSchemaFactory for creating multiple JSONSchema instances,
112112
// these schemas will be cached along with config. We have to replace the config for cached $ref references
113113
// with the latest config. Reset the config.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public EnumValidator(SchemaLocation schemaLocation, JsonNodePath evaluationPath,
8282
}
8383

8484
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
85-
debug(logger, node, rootNode, instanceLocation);
85+
debug(logger, executionContext, node, rootNode, instanceLocation);
8686

8787
if (node.isNumber()) {
8888
node = processNumberNode(node);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public String thresholdValue() {
9898
}
9999

100100
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
101-
debug(logger, node, rootNode, instanceLocation);
101+
debug(logger, executionContext, node, rootNode, instanceLocation);
102102

103103
if (!JsonNodeUtil.isNumber(node, validationContext.getConfig())) {
104104
// maximum only applies to numbers

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public String thresholdValue() {
105105
}
106106

107107
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
108-
debug(logger, node, rootNode, instanceLocation);
108+
debug(logger, executionContext, node, rootNode, instanceLocation);
109109

110110
if (!JsonNodeUtil.isNumber(node, this.validationContext.getConfig())) {
111111
// minimum only applies to numbers

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

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ public class ExecutionConfig {
5454
* Determine if the validation execution can fail fast.
5555
*/
5656
private boolean failFast = false;
57-
57+
58+
/**
59+
* Determine if debugging features such that logging are switched on.
60+
* <p>
61+
* This is turned off by default. This is present because the library attempts
62+
* to log debug logs at each validation node and the logger evaluation on
63+
* whether the logger is turned on is impacting performance.
64+
*/
65+
private boolean debugEnabled = false;
66+
5867
/**
5968
* Gets the locale to use for formatting messages.
6069
*
@@ -180,4 +189,21 @@ public void setAnnotationCollectionFilter(Predicate<String> annotationCollection
180189
"annotationCollectionFilter must not be null");
181190
}
182191

192+
/**
193+
* Gets if debugging features such as logging is switched on.
194+
*
195+
* @return true if debug is enabled
196+
*/
197+
public boolean isDebugEnabled() {
198+
return debugEnabled;
199+
}
200+
201+
/**
202+
* Sets if debugging features such as logging is switched on.
203+
*
204+
* @param debugEnabled true to enable debug
205+
*/
206+
public void setDebugEnabled(boolean debugEnabled) {
207+
this.debugEnabled = debugEnabled;
208+
}
183209
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public FalseValidator(SchemaLocation schemaLocation, JsonNodePath evaluationPath
3636
}
3737

3838
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
39-
debug(logger, node, rootNode, instanceLocation);
39+
debug(logger, executionContext, node, rootNode, instanceLocation);
4040
// For the false validator, it is always not valid
4141
return Collections.singleton(message().instanceNode(node).instanceLocation(instanceLocation)
4242
.locale(executionContext.getExecutionConfig().getLocale())

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected Object getAnnotationValue() {
5959
}
6060

6161
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
62-
debug(logger, node, rootNode, instanceLocation);
62+
debug(logger, executionContext, node, rootNode, instanceLocation);
6363
/*
6464
* Annotations must be collected even if the format is unknown according to the specification.
6565
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public IfValidator(SchemaLocation schemaLocation, JsonNodePath evaluationPath, J
6565

6666
@Override
6767
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
68-
debug(logger, node, rootNode, instanceLocation);
68+
debug(logger, executionContext, node, rootNode, instanceLocation);
6969

7070
boolean ifConditionPassed = false;
7171

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public ItemsValidator(SchemaLocation schemaLocation, JsonNodePath evaluationPath
8787

8888
@Override
8989
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
90-
debug(logger, node, rootNode, instanceLocation);
90+
debug(logger, executionContext, node, rootNode, instanceLocation);
9191

9292
if (!node.isArray() && !this.validationContext.getConfig().isTypeLoose()) {
9393
// ignores non-arrays

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public ItemsValidator202012(SchemaLocation schemaLocation, JsonNodePath evaluati
6565
@Override
6666
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
6767
JsonNodePath instanceLocation) {
68-
debug(logger, node, rootNode, instanceLocation);
68+
debug(logger, executionContext, node, rootNode, instanceLocation);
6969

7070
// ignores non-arrays
7171
if (node.isArray()) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public MaxItemsValidator(SchemaLocation schemaLocation, JsonNodePath evaluationP
4040
}
4141

4242
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
43-
debug(logger, node, rootNode, instanceLocation);
43+
debug(logger, executionContext, node, rootNode, instanceLocation);
4444

4545
if (node.isArray()) {
4646
if (node.size() > max) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public MaxLengthValidator(SchemaLocation schemaLocation, JsonNodePath evaluation
4040
}
4141

4242
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
43-
debug(logger, node, rootNode, instanceLocation);
43+
debug(logger, executionContext, node, rootNode, instanceLocation);
4444

4545
JsonType nodeType = TypeFactory.getValueNodeType(node, this.validationContext.getConfig());
4646
if (nodeType != JsonType.STRING) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public MaxPropertiesValidator(SchemaLocation schemaLocation, JsonNodePath evalua
4242
}
4343

4444
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
45-
debug(logger, node, rootNode, instanceLocation);
45+
debug(logger, executionContext, node, rootNode, instanceLocation);
4646

4747
if (node.isObject()) {
4848
if (node.size() > max) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public String thresholdValue() {
108108
}
109109

110110
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
111-
debug(logger, node, rootNode, instanceLocation);
111+
debug(logger, executionContext, node, rootNode, instanceLocation);
112112

113113
if (!JsonNodeUtil.isNumber(node, this.validationContext.getConfig())) {
114114
// maximum only applies to numbers

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public MinItemsValidator(SchemaLocation schemaLocation, JsonNodePath evaluationP
3939
}
4040

4141
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
42-
debug(logger, node, rootNode, instanceLocation);
42+
debug(logger, executionContext, node, rootNode, instanceLocation);
4343

4444
if (node.isArray()) {
4545
if (node.size() < min) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public MinLengthValidator(SchemaLocation schemaLocation, JsonNodePath evaluation
4040
}
4141

4242
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
43-
debug(logger, node, rootNode, instanceLocation);
43+
debug(logger, executionContext, node, rootNode, instanceLocation);
4444

4545
JsonType nodeType = TypeFactory.getValueNodeType(node, this.validationContext.getConfig());
4646
if (nodeType != JsonType.STRING) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public MinPropertiesValidator(SchemaLocation schemaLocation, JsonNodePath evalua
4242
}
4343

4444
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
45-
debug(logger, node, rootNode, instanceLocation);
45+
debug(logger, executionContext, node, rootNode, instanceLocation);
4646

4747
if (node.isObject()) {
4848
if (node.size() < min) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public String thresholdValue() {
115115
}
116116

117117
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
118-
debug(logger, node, rootNode, instanceLocation);
118+
debug(logger, executionContext, node, rootNode, instanceLocation);
119119

120120
if (!JsonNodeUtil.isNumber(node, this.validationContext.getConfig())) {
121121
// minimum only applies to numbers

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public MultipleOfValidator(SchemaLocation schemaLocation, JsonNodePath evaluatio
4242

4343
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
4444
JsonNodePath instanceLocation) {
45-
debug(logger, node, rootNode, instanceLocation);
45+
debug(logger, executionContext, node, rootNode, instanceLocation);
4646
if (this.divisor != null) {
4747
BigDecimal dividend = getDividend(node);
4848
if (dividend != null) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public NotAllowedValidator(SchemaLocation schemaLocation, JsonNodePath evaluatio
4141
}
4242

4343
public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, JsonNodePath instanceLocation) {
44-
debug(logger, node, rootNode, instanceLocation);
44+
debug(logger, executionContext, node, rootNode, instanceLocation);
4545

4646
Set<ValidationMessage> errors = null;
4747

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNo
4545
protected Set<ValidationMessage> validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode,
4646
JsonNodePath instanceLocation, boolean walk) {
4747
Set<ValidationMessage> errors = null;
48-
debug(logger, node, rootNode, instanceLocation);
48+
debug(logger, executionContext, node, rootNode, instanceLocation);
4949

5050
// Save flag as nested schema evaluation shouldn't trigger fail fast
5151
boolean failFast = executionContext.isFailFast();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected Set<ValidationMessage> validate(ExecutionContext executionContext, Jso
6161
JsonNodePath instanceLocation, boolean walk) {
6262
Set<ValidationMessage> errors = null;
6363

64-
debug(logger, node, rootNode, instanceLocation);
64+
debug(logger, executionContext, node, rootNode, instanceLocation);
6565
int numberOfValidSchema = 0;
6666
int index = 0;
6767
SetView<ValidationMessage> childErrors = null;

0 commit comments

Comments
 (0)