I have found many articles about the circular reference with Gson, but I can't find an elegant solution.
As I know, some solutions is:
- Set the property that caused circular reference as "transient".
- exclude the property with some annotation.
But as a general question, is there some common strategy to solve the problem?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…