Skip to content

Instantly share code, notes, and snippets.

@robfletcher
Created October 30, 2015 21:54
Show Gist options
  • Save robfletcher/cf7760c1d87f70b0f07e to your computer and use it in GitHub Desktop.
Save robfletcher/cf7760c1d87f70b0f07e to your computer and use it in GitHub Desktop.
import sbt._
scalaVersion := "2.11.7"
resolvers += Resolver.jcenterRepo
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.5.2"
)
import com.fasterxml.jackson.annotation.JsonSubTypes.Type
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo}
@JsonTypeInfo(use = Id.NAME, property = "name")
@JsonSubTypes(Array(
new Type(classOf[Vodka.type]),
new Type(classOf[Whiskey])
))
trait Spirit
case object Vodka extends Spirit
case class Whiskey(variety: String) extends Spirit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment