codahale/jerkson — Issue #45: Support for parameterized types
Author: aklossrbh
Created: 2012-02-09 21:38:06+00:00
State: open

Jerkson can't deserialize into parameterized types. For example (based on ExampleCaseClasses.scala):

case class CaseClassWithList[T](id: Long, list: List[T])
parse[CaseClassWithList[CaseClass]]("""{"id":1,"list":[{"id":1,"name":"Coda"}]}""")

will throw a `java.lang.ClassNotFoundException: T`. Unlike issue #9, I'd like to be able to hint in the scala code (not in the JSON) that the parameterized type should be a `CaseClass`. I think something like `parse[CaseClassWithList[CaseClass]](arg, List[Class])` where the list of classes would specify the parameterized types that ClassFileParser can't determine from the bytecode.

Thoughts? Is there a better way to do this? I made a commit in my fork of jerkson which has the full (failing) test case if that helps.