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
问题:WriteNullStringAsEmpty和WriteMapNullValue 两个序列化属性不能同时生效
实例代码:
public static void main(String[] args) { Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("a", 1); jsonMap.put("b", ""); jsonMap.put("c", null); jsonMap.put("d", "哈哈"); String str = JSONObject.toJSONString(jsonMap, SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteMapNullValue); System.out.println(str); }
输出结果: {"a":1,"b":"","c":null,"d":"哈哈"}
期望结果: {"a":1,"b":"","c":"","d":"哈哈"}
版本: 1.2.83
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题:WriteNullStringAsEmpty和WriteMapNullValue 两个序列化属性不能同时生效
实例代码:
输出结果:
{"a":1,"b":"","c":null,"d":"哈哈"}
期望结果:
{"a":1,"b":"","c":"","d":"哈哈"}
版本:
1.2.83
The text was updated successfully, but these errors were encountered: