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
简要描述您碰到的问题。
请填写以下信息:
如何操作可以重现该问题: 直接运行如下代码
@JSONType(serializeFeatures ={JSONWriter.Feature.WriteClassName, JSONWriter.Feature.NotWriteRootClassName}) public static class WrapperClassA { private AbsPojoClassB pojo; public AbsPojoClassB getPojo() { return pojo; } public void setPojo(AbsPojoClassB pojo) { this.pojo = pojo; } } public static class AbsPojoClassB { private Integer int1; private String str2; public Integer getInt1() { return int1; } public void setInt1(Integer int1) { this.int1 = int1; } public String getStr2() { return str2; } public void setStr2(String str2) { this.str2 = str2; } } public static class PojoClassC extends AbsPojoClassB { } public static void main(String[] args) { final WrapperClassA wrapperClassA = new WrapperClassA(); final PojoClassC pojoClassC = new PojoClassC(); pojoClassC.setInt1(1); pojoClassC.setStr2("str"); wrapperClassA.setPojo(pojoClassC); final String jsonStr = JSON.toJSONString(wrapperClassA); System.out.println(jsonStr); }
{"pojo":{"@type":"com.xx.test.TestFastJson$PojoClassC","int1":1,"str2":"str"}}
{"@type":"com.xx.test.TestFastJson$WrapperClassA","pojo":{"@type":"com.xx.test.TestFastJson$PojoClassC","int1":1,"str2":"str"}}
The text was updated successfully, but these errors were encountered:
fix not root class name when specified in @jsontype, for issue #2662
889b5f9
810b240
https://github.com/alibaba/fastjson2/releases/tag/2.0.52 问题已修复,请用新版本
Sorry, something went wrong.
yanxutao89
No branches or pull requests
问题描述
简要描述您碰到的问题。
环境信息
请填写以下信息:
重现步骤
如何操作可以重现该问题:
直接运行如下代码
期待的正确结果
相关日志输出
The text was updated successfully, but these errors were encountered: