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
简要描述您碰到的问题。 无法拦截非 Serializable 的类进行序列化
请填写以下信息:
public static void main(String[] args) { NoneSerializable noneSerializable = new NoneSerializable(); noneSerializable.setParam("Test"); byte[] bytes = JSONB.toBytes(noneSerializable, JSONWriter.Feature.WriteClassName); Object o = JSONB.parseObject(bytes, Object.class, JSONReader.Feature.SupportAutoType); System.out.println(o); } public static class NoneSerializable { private String param; public String getParam() { return param; } public void setParam(String param) { this.param = param; } }
The text was updated successfully, but these errors were encountered:
@Test public void test() { NoneSerializable noneSerializable = new NoneSerializable(); noneSerializable.setParam("Test"); byte[] bytes = JSONB.toBytes(noneSerializable, JSONWriter.Feature.WriteClassName, JSONWriter.Feature.IgnoreNoneSerializable); Object o = JSONB.parseObject(bytes, Object.class, JSONReader.Feature.SupportAutoType); assertNull(o); } public static class NoneSerializable { private String param; public String getParam() { return param; } public void setParam(String param) { this.param = param; } }
需要加上 JSONWriter.Feature.IgnoreNoneSerializable
Sorry, something went wrong.
add testcase for issue #756
8a8196e
813673a
https://github.com/alibaba/fastjson2/releases/tag/2.0.14 问题已修复,请用新版本
No branches or pull requests
问题描述
简要描述您碰到的问题。
无法拦截非 Serializable 的类进行序列化
环境信息
请填写以下信息:
重现步骤
The text was updated successfully, but these errors were encountered: