Fastjson circular reference
fastjson supports circular references and is turned on by default.
Turn off reference support
When the serialized JSON is transmitted to the browser or other languages, these json parsers do not support circular references , resulting in data loss. You can turn off fastjson's circular reference support. Turning off reference detection can also improve serialization performance.
Global configuration shutdown
JSON.DEFAULT_GENERATE_FEATURE |= SerializerFeature.DisableCircularReferenceDetect.getMask();
Non-global shutdown
JSON.toJSONString(obj, SerializerFeature.DisableCircularReferenceDetect);
Description | |
Reference root object | |
Quote yourself | |
Reference the parent object | |
Reference the parent object of the parent object | |
Path-based reference |