We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在单独使用ContextValueFilter时可以正确获取到field,但是在同时使用ContextValueFilter和ContextNameFilter时就会出现获取不到field的情况
请填写以下信息:
public static void main(String[] args) { UserInfo userInfo = new UserInfo(); userInfo.setMobile("13012345678"); userInfo.setUserId(123L); List<Filter> filters = new ArrayList<>(); filters.add((ContextValueFilter) (context, object, name, value) -> { System.out.println("ContextValueFilter field: " + context.getField()); return value; }); filters.add((ContextNameFilter) (context, object, name, value) -> { System.out.println("ContextNameFilter field: " + context.getField()); return name; }); System.out.print(JSON.toJSONString(userInfo, filters.toArray(new Filter[0]))); }
The text was updated successfully, but these errors were encountered:
把UserInfo里的private字段改成public试试。
Sorry, something went wrong.
你看我的图,在单独使用ContextValueFilter时是可以正确获取到field的信息的,但是在加上ContextNameFilter时才会出现两个filter都获取不到field的信息,而且为什么要把bean里的field改成public的,这不是说笑吗
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.39-SNAPSHOT/ 问题已修复,请帮忙用2.0.39-SNAPSHOT版本验证,2.0.39版本预计在8月27日前发布
https://github.com/alibaba/fastjson2/releases/tag/2.0.39 请用新版本
No branches or pull requests
问题描述
在单独使用ContextValueFilter时可以正确获取到field,但是在同时使用ContextValueFilter和ContextNameFilter时就会出现获取不到field的情况
环境信息
请填写以下信息:
重现步骤
附加信息
The text was updated successfully, but these errors were encountered: