Skip to content

Commit

Permalink
Fix updating nested collection fields using JSON Patch
Browse files Browse the repository at this point in the history
Fix updating nested collection fields using JSON Patch

Closes spring-projects#2401
Related tickets spring-projects#2401
  • Loading branch information
EdikAmperyan authored Aug 5, 2024
1 parent 3b71d18 commit 6ec1228
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ private String verify(String pointer, Class<?> type, BiFunction<String, Class<?>
return pointer;
}

PropertyPath base = null;
StringBuilder result = new StringBuilder();
TypeInformation<?> currentType = ClassTypeInformation.from(type);

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

try {
base = base == null ? PropertyPath.from(property, type) : base.nested(segment);
currentType = PropertyPath.from(property, currentType).getTypeInformation();
} catch (PropertyReferenceException o_O) {
throw reject(segment, rejectType, pointer, qualifier);
}

currentType = base.getTypeInformation();

result.append("/").append(property);
}

Expand Down

0 comments on commit 6ec1228

Please sign in to comment.