title: Making a hierarchy with case classes in Scala
body: <p>I have 2 types of documents: PDFDocument and XMLDocument. Both are case classes (I need matching them). 
  Now, I need to have a collection of documents. So, I created PrivateDocument to make a hierarchy. 
  These documents I get it from a request to an external server, so I'd like to validate de response of that request:</p>
  
  <pre><code>response.json.validate[List[ProformaDocument]]
  </code></pre>
  
  <p>The problem is that, if PrivateDocument is a case class, then case-to-case inheritance is prohibited.
  If PrivateDocument is a trait or a class, then I can't deserialize the JSON, because the trait don't have a Reads. </p>
  
  <p>After all of that, I need to return the List to the web page that ask it. So, again, I need to transform the List into a Json array.</p>
  
  <p>What can I do in this cases to make a correct hierarchy and also manage the case class / Json transformation?</p>