diff --git a/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/PathMatcher.java b/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/PathMatcher.java index e9a1537f..ef8024a1 100644 --- a/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/PathMatcher.java +++ b/json-unit-core/src/main/java/net/javacrumbs/jsonunit/core/internal/PathMatcher.java @@ -57,8 +57,8 @@ private static class SimplePathMatcher extends PathMatcher { @Override boolean matches(String pathToMatch) { return path.equals(pathToMatch) - || (path.startsWith("$.") && path.substring(2).equals(pathToMatch)) - || (path.startsWith("$") && path.substring(1).equals(pathToMatch)); + || ((path.startsWith("$.") || path.startsWith("$[")) + && path.substring(2).equals(pathToMatch)); } }