We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 037df8e commit efe93e3Copy full SHA for efe93e3
src/main/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactory.java
@@ -158,13 +158,14 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
158
return isCollectionResult && !(nested instanceof Collection) ? result : nested;
159
}
160
161
- type = isCollectionResult && JsonPath.isPathDefinite(jsonPath)
+ boolean definitePath = JsonPath.isPathDefinite(jsonPath);
162
+ type = isCollectionResult && definitePath
163
? ResolvableType.forClassWithGenerics(List.class, type)
164
: type;
165
166
List<?> result = (List<?>) context.read(jsonPath, new ResolvableTypeRef(type));
167
- if (isCollectionResult && JsonPath.isPathDefinite(jsonPath)) {
168
+ if (isCollectionResult && definitePath) {
169
result = (List<?>) result.get(0);
170
171
0 commit comments