Add contextClass resolution to JacksonJsonDecoder

Issue: SPR-14158
This commit is contained in:
Sebastien Deleuze
2016-07-21 14:56:53 +02:00
parent 610bdf1cc3
commit 9fb8a2eb2e
2 changed files with 8 additions and 7 deletions

View File

@@ -98,8 +98,8 @@ public class JacksonJsonDecoder extends AbstractJacksonJsonCodec implements Deco
MethodParameter methodParameter = (elementType.getSource() instanceof MethodParameter ?
(MethodParameter)elementType.getSource() : null);
// TODO Find a way to pass the real concrete controller contextClass
JavaType javaType = getJavaType(elementType.getType(), null);
Class<?> contextClass = (methodParameter != null ? methodParameter.getContainingClass() : null);
JavaType javaType = getJavaType(elementType.getType(), contextClass);
ObjectReader reader;
if (methodParameter != null && methodParameter.getParameter().getAnnotation(JsonView.class) != null) {