-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] FastJsonConfig 配置writerFilter PropertyFilter 属性过滤,会导致KEY为空 #471
Comments
@William007001 能否提供更详细的信息,比如入参和出参 |
request data public class Test {
} Map<String, List> map = new HashMap<>(); ` response data
说明:外层对象是统一封装的,data属性是接收一个泛型,只有这种情况加了属性过滤器后data里面的对象属性就会变成null,直接返回原本对象正常,感觉是泛型然后属性过滤器就有问题,1.x下正常 |
@William007001 问题已复现并修复,近期会发布快照版本~ |
happy |
问题描述
简要描述您碰到的问题。
Spring mvc 模式下 FastJsonHttpMessageConverter 增加全局写过滤器,属性过滤器,过滤器中实现返回 true,导致KEY = null
环境信息
重现步骤
`
@OverRide
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
List mediaTypes = new ArrayList<>();
mediaTypes.add(MediaType.APPLICATION_JSON);
fastConverter.setSupportedMediaTypes(mediaTypes);
FastJsonConfig fastJsonConfig = new FastJsonConfig();
// fastJsonConfig.setWriterFeatures(GlobalConst.JSON_WRITER_FEATURE);
// fastJsonConfig.setReaderFeatures(GlobalConst.JSON_READER_FEATURE);
fastJsonConfig.setDateFormat(DatePattern.NORM_DATETIME_PATTERN);
fastJsonConfig.setCharset(CharsetUtil.CHARSET_UTF_8);
static class CustomizePropertyFilter implements PropertyFilter {
/**
* 属性过滤
*
* @param object
* @param name
* @param value
* @return
*/
@OverRide
public boolean apply(Object object, String name, Object value) {
return true;
}
}
`
xxx.xxx
方法...
数据...
错误//可在此输入示例代码
期待的正确结果
对您期望发生的结果进行清晰简洁的描述。
相关日志输出
请复制并粘贴任何相关的日志输出。
附加信息
The text was updated successfully, but these errors were encountered: