-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
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
[QUESTION] 请问在fastjson2中,有禁止循环引用的功能吗,就是去掉 $ref 的意思 #2603
Labels
question
Further information is requested
Comments
fastjson2中,缺省就是禁止引用检测的 |
我指的是循环引用,不是引用,如果存在循环引用,fastjson2不使用JSONWriter.Feature.ReferenceDetection,是会报错的,但使用了JSONWriter.Feature.ReferenceDetection,又会出现$ref。 |
我理解错了,不好意思,fastjson1在使用SerializerFeature.DisableCircularReferenceDetect时,如果有循环引用,也会报错。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fastjson1中,可以通过全局设置
JSON.DEFAULT_GENERATE_FEATURE |= SerializerFeature.DisableCircularReferenceDetect.getMask();
或使用
JSON.toJSONString(obj, SerializerFeature.DisableCircularReferenceDetect);
来禁止循环引用
但在fastjson2中,找不到类似的功能。
在使用fastjson v1兼容版本中,也达不到fastjson1的效果。
谢谢!
The text was updated successfully, but these errors were encountered: