I have a circular dependency that I am struggling to solve right now Take these two classes - boiler plate code removed for demo purposes
Class 1
@En
I went with the annotation below in the end
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
Thanks for your help guys
if you are using Jackson HttpMessageConverter, you should check their documentation - http://wiki.fasterxml.com/JacksonFeatureBiDirReferences
You should add annotations shown here:
public class NodeList
{
@JsonManagedReference
public List<NodeForList> nodes;
}
public class NodeForList
{
public String name;
@JsonBackReference public NodeList parent;
public NodeForList() { this(null); }
public NodeForList(String n) { name = n; }
}