title: How to serialize object type to JSON in Scalatra?
body: <p>I am a newbie in Scalatra. I have a servlet with JacksonJsonSupport which serves REST endpoint with list of objects.</p>
  
  <pre><code>class OperationsController extends MyappStack with JacksonJsonSupport {
  
    before() {
      contentType = formats("json")
    }
  
    get("/") {
      Data.operations
    }
  }
  </code></pre>
  
  <p>The <code>Operation</code> is implemented by either <code>Adding</code> or <code>Removing</code> <strong>case classes</strong>. 
  How do I add to the <code>GET /</code> response the specific class to the value? I would like to get as a response:</p>
  
  <pre><code>[
    {
       "operation": "Adding",
       "value": 100
    }
  ]
  </code></pre>
  
  <p>Instead of</p>
  
  <pre><code>[
    {
       "value": 100
    }
  ]
  </code></pre>
  
  <p>Where <code>Adding</code> is a class that extends <code>Operation</code>.</p>