Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

PropertyFilter 和 SerializerFeature.BeanToArray 联合使用有错 #1580

@patrickchense

Description

@patrickchense

需要jsonToString 一个 java bean, 使用了PropertyFilter 和 SerializerFeature.BeanToArray ,想要筛选几个需要的属性,然后去掉key,array输出, code 类似:
SimplePropertyPreFilter classAFilter = new SimplePropertyPreFilter(ClassA.class, "code");
SerializeFilter[] filters =new SerializeFilter[]{classAFilter};
JSON.toJSONString(classA, filters, SerializerFeature.BeanToArray );
但是结果,显示只有SerializerFeature.BeanToArray 起了作用,filter 没有
如果去掉feature, 则可以使filter 起作用
问,如何同时起作用?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions