Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tc/1077437 to your computer and use it in GitHub Desktop.
Save tc/1077437 to your computer and use it in GitHub Desktop.
lift-json 2.4M1 incorrectly parsing option classes?
import org.junit.{Test, Assert}
import org.junit.Assert._
import net.liftweb.json._
import net.liftweb.json.Serialization.write
case class Library(name:String, docs:List[Option[String]])
class AppTest{
@Test
def testMain{
implicit val formats = Serialization.formats(NoTypeHints)
val content = """
{"name":"test", "docs": ["1", "2"]}
"""
val lib = parse(content).extract[Library]
println(lib)
assertEquals(List(Some("1"), Some("2")), lib.docs)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment