Fix regression in MappingJackson2MessageConverter
As of 4.3.13 MappingJackson2MessageConverter uses the MethodParameter hint to obtain generic type information but it needs to be careful, and nest one level, if the target parameter type has a Message wrapper. Issue: SPR-16486
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -237,6 +237,9 @@ public class MappingJackson2MessageConverter extends AbstractMessageConverter {
|
||||
if (conversionHint instanceof MethodParameter) {
|
||||
MethodParameter param = (MethodParameter) conversionHint;
|
||||
param = param.nestedIfOptional();
|
||||
if (Message.class.isAssignableFrom(param.getParameterType())) {
|
||||
param = param.nested();
|
||||
}
|
||||
Type genericParameterType = param.getNestedGenericParameterType();
|
||||
Class<?> contextClass = param.getContainingClass();
|
||||
Type type = getJavaType(genericParameterType, contextClass);
|
||||
|
||||
Reference in New Issue
Block a user