diff --git a/src/JsonSchema/Constraints/Constraint.php b/src/JsonSchema/Constraints/Constraint.php index 389e0f53..f792da5e 100644 --- a/src/JsonSchema/Constraints/Constraint.php +++ b/src/JsonSchema/Constraints/Constraint.php @@ -43,10 +43,15 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface protected function incrementPath(JsonPointer $path = null, $i) { $path = $path ?: new JsonPointer(''); + + if ($i === null || $i === '') { + return $path; + } + $path = $path->withPropertyPaths( array_merge( $path->getPropertyPaths(), - array_filter(array($i), 'strlen') + array($i) ) );