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
在字段三标注 @JSONField(serializeFeatures= {JSONWriter.Feature.WriteClassName}) 无效
请填写以下信息:
code:
import org.junit.Test; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONWriter; import com.alibaba.fastjson2.annotation.JSONField; public class JSONTypeWrite { @Test public void test() { A a = new A(); a.id = 1; a.name = "a"; B b = new B(); b.id = 2; C c = new C(); c.list = new ID[] {a,b}; String str = JSON.toJSONString(c); System.out.printf(str); } public static class C{ @JSONField(serializeFeatures= {JSONWriter.Feature.WriteClassName}) public ID[] list; } public static class A implements ID{ public int id; public String name; @Override public int getId() { return id; } } public static class B implements ID{ public int id; @Override public int getId() { return id; } } public static interface ID{ int getId(); } }
The text was updated successfully, but these errors were encountered:
fix writeClassName not work on JSONField.serializeFeatures, for issue #…
18ee5ab
…1947
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson/2.0.42-SNAPSHOT/ 问题已修复,请帮忙用2.0.42-SNAPSHOT版本验证,正式版本预计在下个周末(11月5日)发布。
Sorry, something went wrong.
https://github.com/alibaba/fastjson2/releases/tag/2.0.42 问题已修复,请用新版本
No branches or pull requests
问题描述
在字段三标注 @JSONField(serializeFeatures= {JSONWriter.Feature.WriteClassName})
无效
环境信息
请填写以下信息:
code:
The text was updated successfully, but these errors were encountered: