@@ -400,6 +400,14 @@ private ValidationResult validateAndCollect(JsonNode jsonNode, JsonNode rootNode
400
400
* @return result of ValidationResult
401
401
*/
402
402
public ValidationResult walk (JsonNode node , boolean shouldValidateSchema ) {
403
+ return walkAtNodeInternal (node , node , AT_ROOT , shouldValidateSchema );
404
+ }
405
+
406
+ public ValidationResult walkAtNode (JsonNode node , JsonNode rootNode , String at , boolean shouldValidateSchema ) {
407
+ return walkAtNodeInternal (node , rootNode , at , shouldValidateSchema );
408
+ }
409
+
410
+ private ValidationResult walkAtNodeInternal (JsonNode node , JsonNode rootNode , String at , boolean shouldValidateSchema ) {
403
411
try {
404
412
// Get the config.
405
413
SchemaValidatorsConfig config = validationContext .getConfig ();
@@ -408,7 +416,7 @@ public ValidationResult walk(JsonNode node, boolean shouldValidateSchema) {
408
416
// Set the walkEnabled flag in internal validator state.
409
417
setValidatorState (true , shouldValidateSchema );
410
418
// Walk through the schema.
411
- Set <ValidationMessage > errors = walk (node , node , AT_ROOT , shouldValidateSchema );
419
+ Set <ValidationMessage > errors = walk (node , rootNode , at , shouldValidateSchema );
412
420
// When walk is called in series of nested call we don't want to load the collectors every time. Leave to the API to decide when to call collectors.
413
421
if (config .doLoadCollectors ()) {
414
422
// Load all the data from collectors into the context.
0 commit comments