[QUESTION]循环引用时如何正常输出内容而非“$ref”
Open
question
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 613
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 6
Description
我的map中有两个同级字段A,B,我使用 map.put(B,A),然后“JSONObject.toJSONString(map)”,如何让其不打印"$ref"而是在B中正常打印A的值呢?
Contributor guide
Research direction
Reproduce the case where a map has sibling fields A and B, B references A via map.put(B, A), and JSONObject.toJSONString(map) emits "$ref". Start by reading the serialization behavior for circular references; done means the B output contains A's value instead of "$ref".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100