title: Scala json4s sealed trait as enums
body: <p>We have our status defined as:</p>
  
  <pre><code>sealed trait Status
  case object Status {
    case object StatusA extends Status
    case object StatusB extends Status
    case object StatusC extends Status
  }
  </code></pre>
  
  <p>Our status looks like:</p>
  
  <pre><code>val status = Status.StatusA
  </code></pre>
  
  <p>Is there any way to (de)serialize that kind of structure with predefined <code>json4s</code> fomratters?</p>
  
  <p>We tried with defult formatter like:</p>
  
  <pre><code>implicit val formats = new org.json4s.DefaultFormats
  </code></pre>
  
  <p>and it did not work. Next we tried to use <code>ext</code> provided by <code>json4s</code> with Enum support:</p>
  
  <pre><code>implicit val formats = org.json4s.DefaultFormats + new org.json4s.ext.EnumSerializer(Status)
  </code></pre>
  
  <p>and it did not work again. We had to totally change the structure of the <code>sealed trait</code> to actual <code>Enumeration</code>s. Is there any way to do it with <code>case class</code>es?</p>