Skip to content

Commit 6ec1228

Browse files
authoredAug 5, 2024
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 3b71d18 commit 6ec1228

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
@@ -71,7 +71,6 @@ private String verify(String pointer, Class<?> type, BiFunction<String, Class<?>
7171
return pointer;
7272
}
7373

74-
PropertyPath base = null;
7574
StringBuilder result = new StringBuilder();
7675
TypeInformation<?> currentType = ClassTypeInformation.from(type);
7776

@@ -105,13 +104,11 @@ private String verify(String pointer, Class<?> type, BiFunction<String, Class<?>
105104
.orElseThrow(() -> reject(segment, rejectType, pointer, qualifier));
106105

107106
try {
108-
base = base == null ? PropertyPath.from(property, type) : base.nested(segment);
107+
currentType = PropertyPath.from(property, currentType).getTypeInformation();
109108
} catch (PropertyReferenceException o_O) {
110109
throw reject(segment, rejectType, pointer, qualifier);
111110
}
112111

113-
currentType = base.getTypeInformation();
114-
115112
result.append("/").append(property);
116113
}
117114

0 commit comments

Comments
 (0)
Please sign in to comment.