Is there a solution about Gson “circular reference”?
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? As far as I know there is no automated solution for circular references in Gson. The only JSON-producing library I know of that handles circular references automatically is XStream (with Jettison backend). EDIT: Jackson also supports handling of circular references with