title: Good REST design with Jackson/Gson
body: <p>I've been developing using Jackson for a couple of years now, but there was always something bothering me:</p>
  
  <p>My models on the server has relations to one another. An example would be the following:
  A <code>Lock</code> has a <code>Person</code> which has a list of <code>LogEntry</code> and each <code>LogEntry</code> has a <code>Lock</code>.
  To get a lock i call <code>/api/lock/id</code> and i would retrieve the persons and log entries as well, however <code>LogEntry</code> references <code>Lock</code> so it would become an infinite loop.</p>
  
  <p>Is there a good way/standard to follow when designing your models? Maybe one should only return the ID's of the references?</p>
  
  <p>I want to avoid circular references(which is impossible with annotations in many cases) but i would also like to avoid writing serializers.</p>
  
  <p>Do you have any other suggestions? (FYI: Im most often using <strong>Backbone</strong> on the client side)</p>