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
请问重复依赖检测机制是什么? 目前好像没有关闭重复依赖但是开启循环依赖的方法? 如下代码ResultList不会产生$ref, ResultMap会产生$ref.
$ref
@Test public void testJSON() { ResultMap resultMap = new ResultMap(); resultMap.setA(Collections.emptyMap()); resultMap.setB(Collections.emptyMap()); System.out.println(JSON.toJSONString(resultMap)); ResultList resultList = new ResultList(); resultList.setA(Collections.emptyList()); resultList.setB(Collections.emptyList()); System.out.println(JSON.toJSONString(resultList)); } public static class ResultMap { private Map<Long, Integer> a; private Map<Long, Integer> b; public Map<Long, Integer> getA() { return a; } public void setA(Map<Long, Integer> a) { this.a = a; } public Map<Long, Integer> getB() { return b; } public void setB(Map<Long, Integer> b) { this.b = b; } } public static class ResultList { private List<Long> a; private List<Long> b; public List<Long> getA() { return a; } public void setA(List<Long> a) { this.a = a; } public List<Long> getB() { return b; } public void setB(List<Long> b) { this.b = b; } }
{"a":{},"b":{"$ref":"$.a"}} {"a":[],"b":[]}
The text was updated successfully, but these errors were encountered:
write reference except Collections.emptyMap(), for issue #2240
0ddf44f
问题已修复,请用新版本 https://github.com/alibaba/fastjson/releases/tag/1.2.55
Sorry, something went wrong.
No branches or pull requests
请问重复依赖检测机制是什么? 目前好像没有关闭重复依赖但是开启循环依赖的方法?
如下代码ResultList不会产生
$ref
, ResultMap会产生$ref
.The text was updated successfully, but these errors were encountered: