Skip to content

Commit 4da9ee5

Browse files
authored
Fix updating nested collection fields using JSON Patch
Fix updating nested collection fields using JSON Patch Closes spring-projects#2401 Related tickets spring-projects#2401
1 parent 21e11ad commit 4da9ee5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/patch/JsonPointerMapping.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ private String verify(String pointer, Class<?> type, BiFunction<String, Class<?>
7474
return pointer;
7575
}
7676

77-
PropertyPath base = null;
7877
StringBuilder result = new StringBuilder();
7978
TypeInformation<?> currentType = ClassTypeInformation.from(type);
8079

@@ -108,13 +107,11 @@ private String verify(String pointer, Class<?> type, BiFunction<String, Class<?>
108107
.orElseThrow(() -> reject(segment, rejectType, pointer, qualifier));
109108

110109
try {
111-
base = base == null ? PropertyPath.from(property, type) : base.nested(segment);
110+
currentType = PropertyPath.from(property, currentType).getTypeInformation();
112111
} catch (PropertyReferenceException o_O) {
113112
throw reject(segment, rejectType, pointer, qualifier);
114113
}
115114

116-
currentType = base.getTypeInformation();
117-
118115
result.append("/").append(property);
119116
}
120117

0 commit comments

Comments
 (0)