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
简要描述您碰到的问题。
请填写以下信息:
如何操作可以重现该问题:
public static void main(String[] args) { SecondMenuGroupUI secondMenuGroupUI = new SecondMenuGroupUI(); secondMenuGroupUI.setGroupId("group1"); secondMenuGroupUI.setGroupName("分组"); // {"groupId":"group1","groupName":"分组"} System.out.println(JSON.toJSONString(secondMenuGroupUI)); } public static class SecondMenuGroupUI implements Serializable { private static final long serialVersionUID = -2525462388282508225L; @JSONField(ordinal = 2) private String groupName; @JSONField(ordinal = 1) private String groupId; @JSONField(ordinal = 3, serializeFeatures = JSONWriter.Feature.WriteNullListAsEmpty) private List<SecondMenuItemUI> secondList; public String getGroupName() { return groupName; } public void setGroupName(String groupName) { this.groupName = groupName; } public String getGroupId() { return groupId; } public void setGroupId(String groupId) { this.groupId = groupId; } public List<SecondMenuItemUI> getSecondList() { return secondList; } public void setSecondList(List<SecondMenuItemUI> secondList) { this.secondList = secondList; } }
对您期望发生的结果进行清晰简洁的描述。
期望输出:{"groupId":"group1","groupName":"分组","secondList":[]} 实际输出:{"groupId":"group1","groupName":"分组"}
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered:
只有在自定义的WebMvcConfigurer#extendMessageConverters方法下设置了fastJsonConfig.setWriterFeatures(JSONWriter.Feature.WriteNullListAsEmpty); 这个属性才能生效,这是什么原因呀?
Sorry, something went wrong.
我来看一下
No branches or pull requests
问题描述
简要描述您碰到的问题。
环境信息
请填写以下信息:
重现步骤
如何操作可以重现该问题:
期待的正确结果
对您期望发生的结果进行清晰简洁的描述。
期望输出:{"groupId":"group1","groupName":"分组","secondList":[]}
实际输出:{"groupId":"group1","groupName":"分组"}
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered: